Skip to content

Commit

Permalink
Revert 7238 and add requirement for more-itertools that works on pyth…
Browse files Browse the repository at this point in the history
…on 2 (#7296)
  • Loading branch information
cheister authored Mar 5, 2019
1 parent fb04321 commit b8ba105
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions 3rdparty/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ future==0.17.1
futures==3.0.5 ; python_version<'3'
Markdown==2.1.1
mock==2.0.0
# TODO(6282): once we can upgrade Pytest to 4.2.1+, we can remove the more-itertools requirement
more-itertools<6.0.0 ; python_version<'3'
packaging==16.8
parameterized==0.6.1
pathspec==0.5.9
Expand Down
6 changes: 3 additions & 3 deletions src/python/pants/backend/python/subsystems/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class PyTest(Subsystem):
def register_options(cls, register):
super(PyTest, cls).register_options(register)
# TODO: This is currently bounded below `3.7` due to #6282.
# TODO: Additionally, this is temporarily pinned to 3.0.7 due to more-itertools 6.0.0 dropping
# Python 2 support: https://github.com/pytest-dev/pytest/issues/4770.
register('--requirements', advanced=True, default='pytest==3.0.7',
register('--requirements', advanced=True, default='pytest>=3.0.7,<3.7',
help='Requirements string for the pytest library.')
register('--timeout-requirements', advanced=True, default='pytest-timeout>=1.2,<1.3',
help='Requirements string for the pytest-timeout library.')
Expand All @@ -32,7 +30,9 @@ def get_requirement_strings(self):
Make sure the requirements are satisfied in any environment used for running tests.
"""
opts = self.get_options()
# TODO(6282): once we can upgrade Pytest to 4.2.1+, we can remove the more-itertools requirement
return (
"more-itertools<6.0.0 ; python_version<'3'",
opts.requirements,
opts.timeout_requirements,
opts.cov_requirements,
Expand Down
24 changes: 12 additions & 12 deletions tests/python/pants_test/rules/test_test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def test_passing_python_test(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 items
collected 1 item
testprojects/tests/python/pants/dummies/test_pass.py .
testprojects/tests/python/pants/dummies/test_pass.py . [100%]
=========================== 1 passed in SOME_TEXT ===========================
Expand All @@ -92,9 +92,9 @@ def test_failing_python_test(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 items
collected 1 item
testprojects/tests/python/pants/dummies/test_fail.py F
testprojects/tests/python/pants/dummies/test_fail.py F [100%]
=================================== FAILURES ===================================
__________________________________ test_fail ___________________________________
Expand All @@ -120,9 +120,9 @@ def test_source_dep(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 items
collected 1 item
testprojects/tests/python/pants/dummies/test_with_source_dep.py .
testprojects/tests/python/pants/dummies/test_with_source_dep.py . [100%]
=========================== 1 passed in SOME_TEXT ===========================
Expand All @@ -139,9 +139,9 @@ def test_thirdparty_dep(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 items
collected 1 item
testprojects/tests/python/pants/dummies/test_with_thirdparty_dep.py .
testprojects/tests/python/pants/dummies/test_with_thirdparty_dep.py . [100%]
=========================== 1 passed in SOME_TEXT ===========================
Expand All @@ -160,9 +160,9 @@ def test_mixed_python_tests(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 items
collected 1 item
testprojects/tests/python/pants/dummies/test_fail.py F
testprojects/tests/python/pants/dummies/test_fail.py F [100%]
=================================== FAILURES ===================================
__________________________________ test_fail ___________________________________
Expand All @@ -177,9 +177,9 @@ def test_fail():
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 items
collected 1 item
testprojects/tests/python/pants/dummies/test_pass.py .
testprojects/tests/python/pants/dummies/test_pass.py . [100%]
=========================== 1 passed in SOME_TEXT ===========================
Expand Down

0 comments on commit b8ba105

Please sign in to comment.