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

Pytest 6.2 warns about the deprecated --strict flag #2863

Closed
Zalathar opened this issue Feb 20, 2021 · 6 comments · Fixed by #2864
Closed

Pytest 6.2 warns about the deprecated --strict flag #2863

Zalathar opened this issue Feb 20, 2021 · 6 comments · Fixed by #2864
Labels
opinions-sought tell us what you think about these ones! tests/build/CI about testing or deployment *of* Hypothesis

Comments

@Zalathar
Copy link
Contributor

Zalathar commented Feb 20, 2021

As of pytest 6.2, the --strict flag is deprecated and issues a warning. Because we include this flag in our pytest.ini (and various other places), all of our pytest invocations produce this annoying warning, making it harder to understand the test results.

(The --strict-markers flag was introduced in pytest 4.5 as an alias for the existing --strict flag, in the hope that --strict could be eventually repurposed into a catch-all strict mode flag.)

In #2862 I tried to fix this by replacing --strict with --strict-markers in our repo. This almost worked, except that check-pytest43 now fails because pytest 4.3 it doesn't understand --strict-markers and errors out.

Before going too far down the rabbit hole of trying to fix that, I thought I'd open an issue for discussion of what we should actually do about this whole situation.

@Zalathar Zalathar added opinions-sought tell us what you think about these ones! tests/build/CI about testing or deployment *of* Hypothesis labels Feb 20, 2021
@Zalathar
Copy link
Contributor Author

I understand that we want to try to support older pytest versions, but is there any particular reason to stick with 4.3?

Back in January of 2020, pytest appears to have stopped active maintenance of pytest 4.6 in favour of best-effort community maintenance.

@Zalathar
Copy link
Contributor Author

For context, the last time we bumped our pytest requirement was #2126 in late 2019.

@Zalathar
Copy link
Contributor Author

I think I've figured out how to make pytest 4.3 not see --strict-markers in pytest.ini, so I might end up reopening #2862 after all.

@Zac-HD
Copy link
Member

Zac-HD commented Feb 20, 2021

I'm perfectly happy to bump our minimum Pytest version to 4.6 and move on - according to the general rule "we support whatever upstream still supports, plus older things if they're still in widespread use and doing so is not inconvenient to us volunteers". Since 4.3 is now inconvenient as well as EOL upstream, it's time to drop support.

On the other hand, if you can make old versions ignore new flags we might as well add --strict-config too!

@Zalathar
Copy link
Contributor Author

At this point the workaround is easier than dropping support (since I've already written the workaround), but I wouldn't object to dropping support anyway.

@Zac-HD
Copy link
Member

Zac-HD commented Feb 20, 2021

I'm voting to drop support for <4.6; it's about time and it saves us the slightly-awkward workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opinions-sought tell us what you think about these ones! tests/build/CI about testing or deployment *of* Hypothesis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants