-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Disable assertion rewriting external modules #13421
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
base: main
Are you sure you want to change the base?
Disable assertion rewriting external modules #13421
Conversation
for more information, see https://pre-commit.ci
…rnal_modules' into disable_assertion_rewriting_external_modules # Conflicts: # testing/test_assertrewrite.py
Need to squash commits - OK to close, I'll reopen a new one with one commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for getting this started
i believe we need to put the path handling into assertion state so it can correctly pass from the configuration and include the invocation dir/rootdir in a more safe manner than the current heusterics
…ath to AssertState
…rnal_modules' into disable_assertion_rewriting_external_modules # Conflicts: # src/_pytest/assertion/rewrite.py # testing/test_assertrewrite.py
23dcf0c
to
54f46d7
Compare
I skimmed through the issue (I'm short on time so I cannot do a more through research), but looking at the code is not immediately clear to me so thought I would ask: Note that we want to rewrite asserts for files belonging to a pytest plugin, even if they are not |
6a9b406
to
1592f85
Compare
At present time the fix is applied only for path which applies |
…rnal_modules' into disable_assertion_rewriting_external_modules # Conflicts: # testing/test_assertrewrite.py
Added some tests for plugin rewriting, it works now |
16f3fc9
to
ba4263d
Compare
with mock.patch.object(hook, "fnpats", ["*.py"]): | ||
assert hook.find_spec("file") is None | ||
|
||
def test_assert_rewrite_correct_for_conftfest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mamy name it in another way - test_assert_rewrite_for_conftfest
4e1f8b9
to
db7dcd4
Compare
for more information, see https://pre-commit.ci
Disable assertion rewriting of external modules. Closes 13403.