-
Notifications
You must be signed in to change notification settings - Fork 75
Fix version comparison handling. #160
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
Changes from 10 commits
9986a1a
bee857d
315ed07
d3d6263
5f557c2
335a298
c621bb2
6568ecb
64d77a5
fb999ce
14573fc
4e104fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
.tox | ||
.cache | ||
dist/ | ||
build | ||
build | ||
.coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
import os | ||
import re | ||
import sys | ||
from packaging.version import parse | ||
|
||
try: | ||
from configparser import ConfigParser | ||
|
@@ -398,12 +399,10 @@ 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 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.""" | ||
|
@@ -625,3 +624,8 @@ def print_failure(self, report): | |
self.write_sep("―", msg) | ||
self._outrep_summary(report) | ||
self.reset_tracked_lines() | ||
|
||
|
||
# On older version of Pytest, allow default progress | ||
if parse(pytest.__version__) <= parse('3.4'): # pragma: no cover | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just out of curiosity: why the "# pragma: no cover" here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is covered on some build job but only old version are supposed to cover this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes.. it also uses flags for different builds. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will address this when rebasing #148. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the PR! |
||
del SugarTerminalReporter.pytest_runtest_logfinish |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,13 @@ | |
[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] | ||
usedevelop = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this was done to get the coverage right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it is so that we use the right file for the coverage. |
||
passenv = CI TRAVIS_BUILD_ID TRAVIS TRAVIS_BRANCH TRAVIS_JOB_NUMBER TRAVIS_PULL_REQUEST TRAVIS_JOB_ID TRAVIS_REPO_SLUG TRAVIS_COMMIT | ||
deps = | ||
codecov>=1.4.0 | ||
|
@@ -20,16 +22,24 @@ 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 | ||
pytest-rerunfailures | ||
rerunfailures: pytest-rerunfailures | ||
Natim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
commands = | ||
py.test --cov=./ {posargs:test_sugar.py} | ||
py.test --cov=. --cov-config=tox.ini {posargs:test_sugar.py} | ||
codecov -e TOXENV | ||
|
||
[testenv:qa] | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 {posargs:conftest.py pytest_sugar.py setup.py test_sugar.py} | ||
|
||
|
||
[coverage:run] | ||
branch = True | ||
omit = | ||
.tox/* | ||
*xdist* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove that.