-
Notifications
You must be signed in to change notification settings - Fork 74
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 version comparison handling. #160
Conversation
3104d33
to
315ed07
Compare
Codecov Report
@@ Coverage Diff @@
## master #160 +/- ##
===========================================
+ Coverage 29.42% 73.95% +44.53%
===========================================
Files 4 4
Lines 503 503
Branches 0 86 +86
===========================================
+ Hits 148 372 +224
+ Misses 355 105 -250
- Partials 0 26 +26
Continue to review full report at Codecov.
|
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.
thats the way to go
If it is present in the |
Ah, I see, it's just not updating dependencies. But I guess that's save enough since packaging 14.1 is over 4 years old. |
For some reason tests might segfault with pypy but it was the case on master before this pull-request. |
pytest_sugar.py
Outdated
@@ -398,7 +399,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 parse(pytest.__version__) >= parse('3.4'): # pragma: no cover |
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.
I don't like the way the code is written with the "current" version being marked as the deviant behavior. I'd write the code differently:
def pytest_runtest_logfinish(self):
"""prevent the default implementation to try to show
pytest's default progress"""
if parse(pytest.__version__) < parse(3.4): # pragma: nocover
# On older Pytest, allow default progress
del pytest_runtest_logfinish
And then you might even put the if
block in a try/except so even if it fails, the more lenient behavior remains.
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.
What would be the harm of including this clause unconditionally, just like its sister method above?
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.
Yes it makes sense, I will do that.
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.
Appreciate the work on this - I'm sure it's breaking a lot of builds. My stylistic considerations should not be reason to delay the release of any fix.
cb4d9db
to
c621bb2
Compare
.travis.yml
Outdated
- env: TOXENV=py37-pytest310-supported-xdist | ||
python: '3.7' | ||
sudo: required | ||
dist: xenial |
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.
Can we use py36 here, since it is easier to setup on Travis?
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.
Do you mean we shouldn't run tests on Python 3.7 ?
I don't understand what you want to say here.
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.
One py37 job is good (which we have).
Here py36-pytest310-supported-xdist
could be used.
However, not really important - it just makes the matrix cleaner and the build a bit faster.
Feel free to skip it however.
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.
@michael-k since this is your code, your voice counts.
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.
I was chiming in since he copied my code (edb4fe6).. ;)
Builds are failing due to "rerunfailures" (I've cleared the caches and restarted the previous build already): https://travis-ci.org/Frozenball/pytest-sugar/jobs/451271386#L591 |
We should only install |
Why is that? However I think this might be out of the scope of this PR |
Because it is not pinned, and they have that requirement by now. |
..and it appears to have no ssl support: https://travis-ci.org/Frozenball/pytest-sugar/jobs/451390861#L600 |
I'll push a fixup. |
It requires pytest >= 3.6 by now.
.travis.yml
Outdated
- TOXENV=py35-pytest30-unsupported-xdist | ||
- TOXENV=pypy-pytest30-supported-xdist | ||
- TOXENV=pypy-pytest31-supported-xdist | ||
- TOXENV=py37-pytest39-supported-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.
tox.ini
Outdated
qa | ||
|
||
[testenv] | ||
usedevelop = True |
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.
I guess this was done to get the coverage right?
While it is faster, I think it is better to not use this on CI.
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.
Yes it is so that we use the right file for the coverage.
|
||
|
||
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity: why the "# pragma: no cover" here?
Shouldn't it either get tested in some build job, or otherwise show up as not being covered then?
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.
It is covered on some build job but only old version are supposed to cover this.
Do you know if codecov will accumulate all the build coverage?
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.
Yes.. it also uses flags for different builds.
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 address this when rebasing #148.
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.
Thanks for the PR!
I hope we get it released soon.
/cc @Frozenball
Fixes #159