Conversation
k-a-il
left a comment
There was a problem hiding this comment.
Good to learn that you could not return from it, nice catch. LGTM
Now that you say it, I looked it up a bit: https://docs.pytest.org/en/stable/how-to/fixtures.html#yield-fixtures-recommended I actually could swap the |
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 10m 49s ⏱️ - 1h 47m 49s Results for commit 44deaf2. ± Comparison against base commit 965a755. This pull request removes 5123 tests. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 20m 19s ⏱️ Results for commit 44deaf2. |
Motivation
Follow up from #13701, the fixture logic was wrong and I could not use early returns, because they were
yieldfixtures, aka generators. See https://docs.pytest.org/en/stable/how-to/fixtures.html#yield-fixtures-recommendedI've updated the fixture to not use
yieldanymore, allowing me to use early returns which makes more sense 👍I've now tested properly the change and it works with no errors 👍 thanks @nik-localstack for surfacing this so quickly!
We got the following error before:
Changes
yieldas they do not have any clean up logic, so that can use early returnTests
Start LocalStack in an external container and run a test from each service like
tests.aws.services.opensearch.test_opensearch.TestOpensearchProvider.test_list_versionsand see that it works 👍Related