Fix "deselect" keyword usage by pytester.assert_outcomes for pytest>6#470
Fix "deselect" keyword usage by pytester.assert_outcomes for pytest>6#470elchupanebrej wants to merge 1 commit intopytest-dev:masterfrom
Conversation
ea96d22 to
7d4f54b
Compare
Codecov Report
@@ Coverage Diff @@
## master #470 +/- ##
==========================================
+ Coverage 95.40% 95.46% +0.05%
==========================================
Files 48 48
Lines 1566 1586 +20
Branches 166 174 +8
==========================================
+ Hits 1494 1514 +20
Misses 45 45
Partials 27 27
Continue to review full report at Codecov.
|
|
Let wait until pytest 7.0 release |
The-Compiler
left a comment
There was a problem hiding this comment.
FWIW I opened a discussion about this on the pytest side too: pytest-dev/pytest#9471
If we decide to stick with the change (likely, I think), having a single assert_outcomes helper function might lead to cleaner code than having if's scattered everywhere.
Also note that pkg_resources is discouraged, I added a comment about it.
|
|
||
| NOT_EXISTING_FEATURE_PATHS = [".", "/does/not/exist/"] | ||
|
|
||
| assert_outcomes_extra = pkg_resources.get_distribution("pytest").parsed_version >= pkg_resources.parse_version("7.0.0") |
There was a problem hiding this comment.
Note that pkg_resources is a third-party dependency (part of setuptools, but not the stdlib), and is officially discouraged:
Use of pkg_resources is discouraged in favor of importlib.resources, importlib.metadata, and their backports (resources, metadata). Please consider using those libraries instead of pkg_resources.
Note that importlib.metadata also only was added in Python 3.8. However, pytest 7 added pytest.version_tuple, so you could get the version from there (and assume False when it does not exist).
There was a problem hiding this comment.
pytest_bdd supports pytest<7 and python=3.7, so for now - this is not an option
7d4f54b to
2e51390
Compare
|
Closed because of #466 |
This address #466