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

Add requirement for more-itertools that works on python 2 #7296

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Eric-Arellano marked this conversation as resolved.
Show resolved Hide resolved
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'",
Eric-Arellano marked this conversation as resolved.
Show resolved Hide resolved
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