Skip to content
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

--strict option is not related to warnings at all #2444

Closed
nicoddemus opened this issue May 29, 2017 · 6 comments
Closed

--strict option is not related to warnings at all #2444

nicoddemus opened this issue May 29, 2017 · 6 comments

Comments

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented May 29, 2017

(venv) $ pytest --help
...
  --strict              run pytest in strict mode, warnings become errors
...

(venv) $ pytest --strict test_something.py 
========================== test session starts ==========================
platform darwin -- Python 3.6.1, pytest-3.1.0, py-1.4.33, pluggy-0.4.0
rootdir: /Users/okken/projects/book/bopytest/Book/code/foo, inifile:
collected 0 items 

=========================== warnings summary ============================
test_something.py::TestHelper
  cannot collect test class 'TestHelper' because it has a __init__ constructor

-- Docs: http://doc.pytest.org/en/latest/warnings.html
====================== 1 warnings in 0.01 seconds =======================
@RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented May 29, 2017

it seems to be used only and explicitly only in the mark module which doesnt issue warnings about unknown marks at the moment

so strict was never implemented correct

@The-Compiler
Copy link
Member

@The-Compiler The-Compiler commented May 29, 2017

--strict was added before pytest had a concept of warnings really - I also remember there was a discussion about how it'd be bad for --strict to introduce more failures (a viewpoint I'm not sure I agree with, FWIW), because everyone is using it for marker warnings already anyways.

@RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented May 29, 2017

so we either start a rename process so its named for what it actually does or make it fail more things

@okken
Copy link
Contributor

@okken okken commented May 30, 2017

If it never worked as described, I would recommend changing the help text to state that --strict turns on the requirement that markers have to be declared and remove the reference to warnings.

@nicoddemus
Copy link
Member Author

@nicoddemus nicoddemus commented May 30, 2017

Definitely!

@nicoddemus nicoddemus changed the title --strict option doesn't appear to work --strict option is not related to warnings at all May 30, 2017
@nicoddemus
Copy link
Member Author

@nicoddemus nicoddemus commented May 30, 2017

I propose we just update the help text related to --strict, and document more prominently how to turn warnings into errors: -W error.

nicoddemus added a commit to nicoddemus/pytest that referenced this issue Jul 4, 2017
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jul 4, 2018
…est. r=ato

Currently the "--strict" option is used to turn warnings into
errors. But even the help content says that, it is not true.
Instead this option is only used for markers.

To actually turn warnings into errors the "-W error" option
would have to be used.

More details see:
pytest-dev/pytest#2444

MozReview-Commit-ID: AQMwZlwC46w

--HG--
extra : rebase_source : 9cc0cffa2d6b5f3082a9e6b93ec729a4601481fc
mcmanus pushed a commit to mcmanus/gecko that referenced this issue Jul 5, 2018
…est. r=ato

Currently the "--strict" option is used to turn warnings into
errors. But even the help content says that, it is not true.
Instead this option is only used for markers.

To actually turn warnings into errors the "-W error" option
would have to be used.

More details see:
pytest-dev/pytest#2444

MozReview-Commit-ID: AQMwZlwC46w
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…est. r=ato

Currently the "--strict" option is used to turn warnings into
errors. But even the help content says that, it is not true.
Instead this option is only used for markers.

To actually turn warnings into errors the "-W error" option
would have to be used.

More details see:
pytest-dev/pytest#2444

MozReview-Commit-ID: AQMwZlwC46w

UltraBlame original commit: e4190bcbd4ef1b4dc8bb21c265c667cd007326d1
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…est. r=ato

Currently the "--strict" option is used to turn warnings into
errors. But even the help content says that, it is not true.
Instead this option is only used for markers.

To actually turn warnings into errors the "-W error" option
would have to be used.

More details see:
pytest-dev/pytest#2444

MozReview-Commit-ID: AQMwZlwC46w

UltraBlame original commit: e4190bcbd4ef1b4dc8bb21c265c667cd007326d1
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…est. r=ato

Currently the "--strict" option is used to turn warnings into
errors. But even the help content says that, it is not true.
Instead this option is only used for markers.

To actually turn warnings into errors the "-W error" option
would have to be used.

More details see:
pytest-dev/pytest#2444

MozReview-Commit-ID: AQMwZlwC46w

UltraBlame original commit: e4190bcbd4ef1b4dc8bb21c265c667cd007326d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants