-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update pytest requirement from ~=7.4 to ~=8.2 #9576
Conversation
This comment has been minimized.
This comment has been minimized.
@dependabot recreate |
3771d98
to
3812d0d
Compare
This comment has been minimized.
This comment has been minimized.
I bisected this issue to pytest-dev/pytest@a21fb8 (introduced in pytest-dev/pytest#11138 released in pytest 8.0.0), this was rather long to do because launching a failing test alone does not trigger the error (You have to launch the whole test suite to reproduce). I supposed there's some test contamination in the pylint test suite initially but it might also be an issue with the test discovery from pytest seeing the offending commit. |
Removing blocker label because we can release by testing with pytest < 8.0.0 |
Need to investigate and fix a test contamination or worse
4cf3b21
to
49a7a61
Compare
This comment has been minimized.
This comment has been minimized.
A newer version of pytest exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged. |
Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@7.4.0...8.2.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Suggestion from pytest-dev/pytest#11138 (comment) With 'pytest' (launching the whole pylint test suite): FAILED tests/test_precedence.py::test_package - AssertionError: E: 21: Module 'package.AudioTime' has no 'DECIMAL' member<function Equals.<locals>.<lambda> at 0x76c566741750> With 'pytest tests/test_precedence.py': tests/test_precedence.py . [100%] ============================================================================================ 1 passed in 1.04s ============================================================================================= With 'python tests/test_precedence.py': Checked ['package.__init__'] successfully Checked ['precedence_test'] successfully Checked ['import_package_subpackage_module'] successfully Checked ['pylint.checkers.__init__'] successfully Checked ['/home/pierre/pylint/tests/regrtest_data/classdoc_usage.py'] successfully Checked ['/home/pierre/pylint/tests/regrtest_data/module_global.py'] successfully Checked ['/home/pierre/pylint/tests/regrtest_data/decimal_inference.py'] successfully Checked ['/home/pierre/pylint/tests/regrtest_data/absimp/string.py'] successfully Checked ['/home/pierre/pylint/tests/regrtest_data/bad_package'] successfully
604c55d
to
80cd3a3
Compare
80cd3a3
to
bf334db
Compare
Damn, nice catch ! Who is to blame for this horrendous Ho, no. |
This comment has been minimized.
This comment has been minimized.
Used https://github.com/asottile/detect-test-pollution which is really helpful here. Found another pollution. The mock of |
This comment has been minimized.
This comment has been minimized.
I think that is the last of it. I really don't understand why the bump causes this. My main intuition is just faster test runs make it so the pollution is more prominent but I have no idea. All of these issues existed before this PR as well. Edit: Looking at the output it is pretty clear. @Pierre-Sassoulas I think this is ready for review now. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9576 +/- ##
==========================================
+ Coverage 95.82% 95.83% +0.01%
==========================================
Files 174 174
Lines 18810 18809 -1
==========================================
+ Hits 18024 18025 +1
+ Misses 786 784 -2
|
This comment has been minimized.
This comment has been minimized.
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.
Thank you, amazing !
So the precise commit causing the issue is pytest-dev/pytest@a21fb8, looking at it, I don't think it was a speed issue. My intuition is now that it's:
The
path
property ofPackage
nodes now points to the package directory instead of the__init__.py
file.
that changed the way the pyi were taken into account (?). The ast is also modified in pytest see pytest-dev/pytest#11138 (comment) (which is an issue really, maybe pylint doesn't actually work without what pytest does to the AST first... but I don't really want to migrate back to unittest !) so it could be something else entirely (?)
All in all, very hard to tell without even more bisection inside this particular commit and analysis. As you managed to bruteforce our way to a green CI we don't need to understand how we could have done it super fast by understanding what happened 😅 . But it does bug me. And pylint-pytest have similar issues with pytest 8.2.1 (see pylint-dev/pylint-pytest#67 (comment)) so understanding what happened could still help.
tests/regrtest_data/pyi/a_module_that_we_definitely_dont_use_in_the_functional_tests.pyi
Outdated
Show resolved
Hide resolved
…n_the_functional_tests.pyi
Ah of course!
No, it just changes the test execution order. All these failures could be reproduced on older versions of
With https://github.com/asottile/detect-test-pollution it really is easy to find the pollution. Takes about 2 or 3 times the total execution time of the full suite. |
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit f495fb5 |
Hmm, right, I should just have searched for test contamination given it was my first hypothesis (pytest-dev/pytest#11138 (comment)) before searching for more convoluted issues 😅 Thanks for handling it ! |
Updates the requirements on pytest to permit the latest version.
Release notes
Sourced from pytest's releases.
... (truncated)
Commits
6bd3f31
Tweak changelog for 8.2.09b6219b
Prepare release version 8.2.0835765c
Merge pull request #12130 from bluetech/fixtures-inline7e7503c
unittest: report class cleanup exceptions (#12250)882c4da
fixtures: inlinefail_fixturefunc
2e8fb9f
fixtures: extract a_check_fixturedef
methodacf2971
fixtures: inline_getnextfixturedef
into_get_active_fixturedef
3c77aec
fixtures: move "request" check earlyd217d68
fixtures: inline_compute_fixture_value
530be28
fixtures: use early return in_get_active_fixturedef
You can trigger a rebase of this PR by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)