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

Resolve pytest warnings about the deprecated --strict flag #2864

Merged
merged 1 commit into from Feb 21, 2021

Conversation

Zalathar
Copy link
Contributor

(New version of #2862; fixes #2863.)

@Zalathar Zalathar added the tests/build/CI about testing or deployment *of* Hypothesis label Feb 20, 2021
@Zalathar Zalathar force-pushed the pytest-strict-markers branch 2 times, most recently from 8263acf to 5232992 Compare February 20, 2021 07:57
@Zalathar
Copy link
Contributor Author

I'm not sure if the coverage invocations in tox.ini actually need an explicit --strict/--strict-markers, but I didn't want to spend the time to investigate so I just converted them. 🤷‍♂️

@Zalathar
Copy link
Contributor Author

If #2865 lands then I'll be able to get rid of all the workarounds for pytest 4.3.

These flags have the same effect in existing versions of pytest, but
--strict is deprecated in pytest 6.2 onwards.
Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Zalathar 🎉

@Zac-HD Zac-HD merged commit c5dca18 into HypothesisWorks:master Feb 21, 2021
@Zalathar Zalathar deleted the pytest-strict-markers branch February 21, 2021 01:31
@sobolevn
Copy link
Member

I am a bit late to the party, but --strict-config also looks nice: https://docs.pytest.org/en/stable/deprecations.html#the-strict-command-line-option

Should we add it as well?

@Zac-HD
Copy link
Member

Zac-HD commented Feb 23, 2021

Tempting, but it's not supported on 4.6! IMO we can run that occasionally by hand, and go back to --strict once that's re-supported as an all-in-one flag.

@Zalathar
Copy link
Contributor Author

The key limitation is that we can’t add relatively-new flags to pytest.ini, unless we commit to a slightly annoying override in the legacy-pytest task.

(The override is honestly not that bad, so I’m fine with it if a new flag adds significant value, but I’m not convinced that --strict-config clears that bar.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests/build/CI about testing or deployment *of* Hypothesis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pytest 6.2 warns about the deprecated --strict flag
3 participants