-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
add --disable-plugin-autoload #13253
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
Conversation
I don't have answers for those questions, sorry, but I'm happy to say that the PR is looking good overall, and I'm looking forward to merging it once they're resolved and CI is green 🙂 |
I can't repro the pypy fail locally, but I'm not sure if spec matters, so ?? I've updated comments to something that almost makes sense to merge with, but ... it's a mess. |
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.
This looks good to me, but I'd appreciate a second opinion before merging. Maybe @nicoddemus?
Will do, likely tomorrow! 👍 |
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.
Can't say much about all the things that are going on in the tests, just a few nitpicks I noticed while looking through the diff.
if mode == "plain": | ||
expected = "E AssertionError" | ||
elif mode == "rewrite": | ||
expected = "*assert 10 == 30*" | ||
else: | ||
assert 0 | ||
result.stdout.fnmatch_lines([expected]) | ||
|
||
if not disable_plugin_autoload or explicit_specify: |
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.
With all the additional logic in this test, I wonder if it would be better to have a fixture for the hampkg
and split this into two distinct tests at least (autoload enabled/disabled)?
Co-authored-by: Florian Bruhin <[email protected]>
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.
Thanks @jakkdl for the PR, appreciate it!
testing/test_assertion.py
Outdated
# FIXME: if it's already loaded then you get a ValueError: "Plugin already | ||
# registered under a different name." | ||
# vaguely related to https://github.com/pytest-dev/pytest/issues/5661 | ||
name = "spamplugin" if disable_plugin_autoload else "spam" |
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.
The difference here is that when loading via entry point, the plugin can choose its own name (name = 'spam'
), but when loading via other methods the name of the module is used (spamplugin
).
I have simplified things here by always using spamplugin
as the name of the plugin (b157cef).
fixes #8969
I'm pretty sure the implementation is solid, but I have a bunch of question marks in comments that should be resolved before merging. I can probably resolve them on my own by digging deep enough into the innards, but wouldn't mind explanations if somebody is more familiar with that territory.
I'm not entirely sure that
test_installed_plugin_rewrite
should be parametrized to hell, as opposed to creating a dedicated test.I also found a random unrelated typo in
test_installed_plugin_rewrite
withcheck_first
->check_first2
, so fixed that + improved thefnmatch_lines
.changelog
folder, with a name like<ISSUE NUMBER>.<TYPE>.rst
. See changelog/README.rst for details.