Skip to content

Commit

Permalink
Pin pytest version to avoid induced breakage from more-itertools tran…
Browse files Browse the repository at this point in the history
…sitive dep (pantsbuild#7238)

### Problem

A floating transitive dependency of pytest, `more-itertools`, dropped support for python 2 in its 6.0.0 release -- see pytest-dev/pytest#4770. This is currently breaking our and our users' CI: see https://travis-ci.org/pantsbuild/pants/jobs/492004734. We could pin that dep, but as mentioned in pytest-dev/pytest#4770 (comment), pinning transitive deps of pytest would impose requirement constraints on users of pytest in pants.

### Solution

- Pin `pytest==3.0.7` for now.

### Result

python tests should no longer be broken.
  • Loading branch information
cosmicexplorer authored Feb 12, 2019
1 parent 3d7a295 commit d0432df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/python/pants/backend/python/subsystems/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ 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.
register('--requirements', advanced=True, default='pytest>=3.0.7,<3.7',
# 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',
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 Down
12 changes: 6 additions & 6 deletions tests/python/pants_test/rules/test_test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_passing_python_test(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 item
collected 1 items
testprojects/tests/python/pants/dummies/test_pass.py . [100%]
Expand All @@ -92,7 +92,7 @@ def test_failing_python_test(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 item
collected 1 items
testprojects/tests/python/pants/dummies/test_fail.py F [100%]
Expand Down Expand Up @@ -120,7 +120,7 @@ def test_source_dep(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 item
collected 1 items
testprojects/tests/python/pants/dummies/test_with_source_dep.py . [100%]
Expand All @@ -139,7 +139,7 @@ def test_thirdparty_dep(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 item
collected 1 items
testprojects/tests/python/pants/dummies/test_with_thirdparty_dep.py . [100%]
Expand All @@ -160,7 +160,7 @@ def test_mixed_python_tests(self):
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 item
collected 1 items
testprojects/tests/python/pants/dummies/test_fail.py F [100%]
Expand All @@ -177,7 +177,7 @@ def test_fail():
platform SOME_TEXT
rootdir: SOME_TEXT
plugins: SOME_TEXT
collected 1 item
collected 1 items
testprojects/tests/python/pants/dummies/test_pass.py . [100%]
Expand Down

0 comments on commit d0432df

Please sign in to comment.