-
Notifications
You must be signed in to change notification settings - Fork 13
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
This plugin should not enable itself automatically #6
Comments
I wish I'd been cognizant of this when I first wrote it. Changing this now will be backwards incompatible, but I'm probably still the biggest user of this (in my other projects) so yea I'll look into fixing this & putting out a major release version at some point 😐 |
Another example: pytest-xdist also affected, when pytest-relaxed is installed. We either need this (all pytest plugins, actually) disabled by default, and/or a command line method in pytest to deterministically disable all plugins that aren't otherwise explicitly enabled by the test suite being run |
👋 You could add a def pytest_addoption(parser):
group = parser.getgroup("pytest-relaxed")
group.addoption('--relax',
action="store_true",
help='Enable pytest-relaxed') https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_addoption Then, to solve the backwards incompatibility problems, you would need to add documentation for users. Either, they add [pytest]
addopts =
--relaxed https://docs.pytest.org/en/latest/reference.html#configuration-options In your other projects, I would suggest the latter. |
Oh, and check for pytest-relaxed/pytest_relaxed/plugin.py Lines 34 to 44 in 8e4d698
def pytest_conifgure(config):
if (config.getoption('collectonly')
or config.getoption('markers')
or config.getoption('showfixtures')):
pass
elif not config.getoption('relaxed'):
return
... Edit: Added condition for |
sounds like this is just waiting for a PR, anyone up for it? |
Apparently installing pytest-relaxed causes the 'relaxed' rules to start applying automatically to all projects. This is causing huge breakage for Gentoo. Two example packages affected by this are hpack and pyftpdlib.
Could you please make the plugin disable new behavior by default, and require explicitly enabling it via command-line, like most of pytest plugins seem to do?
The text was updated successfully, but these errors were encountered: