New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: 'PYTEST_CURRENT_TEST' when running in pytest #2559
Comments
Running this with Python37 gives a bit more background information:
The erring line was introduced in this PR: #2285 |
In your test, you're introducing two instances of the class 'mock_s3'. The PR above introduced class-level variables to mock AWS credentials, so it's now required to call 'start()' before calling 'stop()' on the same class-instance. Changing your test case to either one of the following setups will work:
Or
|
Thanks for the tip, using the same mocking instance fixes the problem that I was seeing. The first setup doesn't propagate the mock_s3 environment into the cases where the fixture is used, though. |
For reference, this is how I generated my testing fixtures: #620 (comment) |
The latest version of moto (1.3.14) is breaking in the following test scenario:
test.py
tox.ini
Running
tox
with these two files at the root returns the following error.Setting
moto == 1.3.13
fixes this.The text was updated successfully, but these errors were encountered: