-
Notifications
You must be signed in to change notification settings - Fork 6
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
Act block with context not recognised correctly #192
Comments
Thanks for raising this - it probably should be better documented in the "rules and error codes" which will be handled by #191 This behaviour was changed in #146 < which contains further examples. TL;DR the context manager starting with the
Flake8-AAA wants all the def test_with():
a_class = AClass()
with freeze_time("2021-02-02 12:00:02"):
result = a_class.action('test')
assert result == 'test' Does that formatting work in your project? |
Thanks for the really quick reply. Yes, that does indeed work. Sorry, I did try something like that after reading #146 , but for some reason it didn't work. I've updated my tests now and they are all passing in Thanks! |
As of Black def test(cli_runner, audit_path: pathlib.Path) -> None:
with mock.patch("validate.__main__.download", new=fake_download(audit_path)):
-
result = cli_runner.invoke(main, ["all", "201901", "-v"])
assert result.exit_code == 0 Black wants to remove the blank line. I'm not going to reopen this, but will create a new ticket. |
Paper trail:
|
Hi @jamescooke thank you for handling the Thanks |
New issue for Black and context managers is here: #200 |
Describe the bug
When I've got a
with
statement providing context as part of an act block and I have a arrange block above I getflake8-aaa
errors when I don't think I should.I encountered this when upgrading from
flake8-aaa
0.11.1
to0.12.2
Share debugging output
With
# act
comment:without
# act
comment:Flake8:
Please share the Python version and platform you are using:
python --version
): Python 3.8.5Expected behavior
Expect to distinguish an act block with a
with
statement wrapping the test action. This seems to happen for me withwith freeze_time(""):
but it's ok when usingwith pytest.raises
Additional context
Using:
freezegun = "1.2.1"
Source code:
The text was updated successfully, but these errors were encountered: