Skip to content

Commit

Permalink
Fix support for pytest >= 3.10
Browse files Browse the repository at this point in the history
Regards Teemu#133
Fixes Teemu#159
  • Loading branch information
michael-k authored and Rémy HUBSCHER committed Nov 5, 2018
1 parent 56c085d commit 9986a1a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ matrix:
python: '3.7'
sudo: required
dist: xenial
- env: TOXENV=py37-pytest310-supported-xdist
python: '3.7'
sudo: required
dist: xenial
install: pip install -U tox
script:
- tox
2 changes: 1 addition & 1 deletion pytest_sugar.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def pytest_runtest_logstart(self, nodeid, location):
# show the module_name & in verbose mode the test name.
pass

if pytest.__version__ >= '3.4':
if tuple(int(x) for x in pytest.__version__.split('.')[:2]) >= (3, 4):

def pytest_runtest_logfinish(self):
# prevent the default implementation to try to show
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
[tox]
envlist = py{27,34,35,36,py}-pytest30-supported-xdist,
py{27,35}-pytest30-unsupported-xdist,
py{27,34,py}-pytest31-supported-xdist
py{27,34,py}-pytest34-supported-xdist
py{27,34,py}-pytest31-supported-xdist,
py{27,34,py}-pytest34-supported-xdist,
py37-pytest{39,310}-supported-xdist,
qa

[testenv]
Expand All @@ -20,6 +21,7 @@ deps =
pytest34: pytest>=3.4,<3.5
pytest37: pytest>=3.7,<3.8
pytest39: pytest>=3.9,<3.10
pytest310: pytest>=3.10,<3.11
termcolor>=1.1.0
supported-xdist: pytest-xdist>=1.14
unsupported-xdist: pytest-xdist<1.14
Expand Down

0 comments on commit 9986a1a

Please sign in to comment.