-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TST: display reason of skipping by default with pytest #10946
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
TST: display reason of skipping by default with pytest #10946
Conversation
You need to figure out why the Python 3.4 is failing. No suggestions off the top of my head I am afraid ... About 20 lines in the Python 3.6 build (with numpy >= 1.14) About 100 lines in the Python 2.7 build (with numpy < 1.14) I am fine with merging this. It is useful in the numpy >= 1.14 case to avoid suprises. You could also argue it is useful in general to be reminded about skipped tests that we may want to fix at one point. |
Hmm, one thing I can think of that the failing build seems to use a much older version of pytest (3.0.5 vs 3.5.0). I think the reason for this is that conda does not have recent packages anymore for Python 3.4 (both main channel as conda-forge). |
build_tools/travis/install.sh
Outdated
@@ -61,6 +61,8 @@ if [[ "$DISTRIB" == "conda" ]]; then | |||
|
|||
conda create -n testenv --yes $TO_INSTALL | |||
source activate testenv | |||
conda install pip --yes |
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.
- pip is installed in any conda environment (at least by default) so you don't need this line
- can you only install pytest if $PYTHON_VERSION == "3.4" so that we can drop this special case once we stop supporting Python 3.4?
- can you use
pip install --upgrade --no-deps pytest
. Just a bit paranoid withpip install -U
that upgrades all the dependencies ...
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, I was planning to do those things, just wanted to make sure it was actually fixing it before diving putting time in it :-)
Will clean up now
a63d26b
to
0654b98
Compare
@@ -62,6 +62,11 @@ if [[ "$DISTRIB" == "conda" ]]; then | |||
conda create -n testenv --yes $TO_INSTALL | |||
source activate testenv | |||
|
|||
# for python 3.4, conda does not have recent pytest packages | |||
if [[ "$PYTHON_VERSION" == "3.4" ]]; 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.
If it's possible to use another conda channel, that might be better than overwriting a conda install with pip
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's not in defaults, and not in conda-forge, and from a quick search on anaconda.org it does not seem they have their own channel
setup.cfg
Outdated
@@ -7,6 +7,7 @@ test = pytest | |||
addopts = | |||
--doctest-modules | |||
--disable-pytest-warnings | |||
-r s |
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.
Could we please use the long form options?
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 changed 's' to 'skipped' (that apparently works), but for "-r" I don't see any long format in the pytest help
I'll take your word on -r. |
build_tools/travis/install.sh
Outdated
@@ -62,6 +62,11 @@ if [[ "$DISTRIB" == "conda" ]]; then | |||
conda create -n testenv --yes $TO_INSTALL | |||
source activate testenv | |||
|
|||
# for python 3.4, conda does not have recent pytest packages | |||
if [[ "$PYTHON_VERSION" == "3.4" ]]; then | |||
pip install --upgrade --no-deps pytest |
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.
If I had to guess how to quickly fix the error, I would do pip install pytest==3.5
.
I guess I was a bit naive about pip install --upgrade --no-deps
. It probably does not install dependencies and I was hoping it would only avoid upgrading the dependencies.
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.
Or if six is the only missing dependency, install that as well.
But actually, somewhat below we also do pip install coverage codecov
, so maybe we don't need to care to much about not installing dependencies with pip?
Travis passes, I am going to merge this one. Thanks @jorisvandenbossche for making the world a slightly less surprising place ;-). |
Thanks! |
I think this should have been
currently passing tests are also included in the test summary in the end |
Reference Issues/PRs
See discussion in #10835 (comment)
Actually doing this change, will make it easier to see how it looks on Travis to decide if this is too verbose or not.
With this change,
pytest
will show the reason that a test is skipped by default. This can be especially useful to not be surprised why your doctests are skipping because you don't have numpy 1.14.