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

Fix incompatibility with pytest 3.4 #133

Merged
merged 2 commits into from
Feb 6, 2018
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
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ addons:
env:
- TOXENV=py27-pytest30-supported-xdist
- TOXENV=py27-pytest31-supported-xdist
- TOXENV=py27-pytest34-supported-xdist
- TOXENV=py27-pytest30-unsupported-xdist
- TOXENV=py34-pytest30-supported-xdist
- TOXENV=py34-pytest31-supported-xdist
- TOXENV=py34-pytest34-supported-xdist
- TOXENV=py35-pytest30-supported-xdist
- TOXENV=py35-pytest34-supported-xdist
- TOXENV=py36-pytest30-supported-xdist
- TOXENV=py36-pytest34-supported-xdist
- TOXENV=py35-pytest30-unsupported-xdist
- TOXENV=pypy-pytest30-supported-xdist
- TOXENV=pypy-pytest31-supported-xdist
Expand Down
7 changes: 7 additions & 0 deletions pytest_sugar.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,13 @@ def pytest_runtest_logstart(self, nodeid, location):
# show the module_name & in verbose mode the test name.
pass

if pytest.__version__ >= '3.4':

def pytest_runtest_logfinish(self):
# prevent the default implementation to try to show
# pytest's default progress
pass

def report_key(self, report):
"""Returns a key to identify which line the report should write to."""
return report.location if self.showlongtestinfo else report.fspath
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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

[testenv]
passenv = CI TRAVIS_BUILD_ID TRAVIS TRAVIS_BRANCH TRAVIS_JOB_NUMBER TRAVIS_PULL_REQUEST TRAVIS_JOB_ID TRAVIS_REPO_SLUG TRAVIS_COMMIT
Expand All @@ -15,6 +16,7 @@ deps =
pytest-cov
pytest30: pytest>=3.0,<3.1
pytest31: pytest>=3.1,<3.2
pytest34: pytest>=3.4,<3.5
termcolor>=1.1.0
supported-xdist: pytest-xdist>=1.14
unsupported-xdist: pytest-xdist<1.14
Expand Down