-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Switch testing to pytest completely #7974
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
Conversation
attn @story645 I think I recognize this issue...
@QuLogic Might want to turn off the fast-fail while we debug this? |
What version of numpy is that test using? that looks like the fun joy where numpy pre like 1.8 truncates inf and nan to the length of the largest string in the array, which in this case is 1. |
It looks like NumPy 1.7.1. Though I have a bigger question of why so few tests seem to be run compared to locally. |
Side note: that PR is going to conflict against #7970 |
@@ -4,10 +4,9 @@ | |||
# |
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't we just remove this script?
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.
Not against it, but also not going to make that decision unilaterally.
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 strongly prefer this script stay and remain functional.
lib/matplotlib/tests/test_ticker.py
Outdated
@@ -240,7 +237,7 @@ def _sub_labels(axis, subs=()): | |||
assert label_test == label_expected | |||
|
|||
|
|||
@cleanup(style='default') | |||
@pytest.mark.style('default') |
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.
Why is the style classic being replaced by default?
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.
Both lines say default 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.
Indeed, they do… I thought I had seen some classic being converted to default, but I guess we'll see this once the tests run on travis anyways.
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.
There are a few that do; see #7973 for an explanation.
.travis.yml
Outdated
@@ -155,20 +151,20 @@ script: | |||
rm -rf ~/.cache/matplotlib | |||
fi | |||
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples | |||
# Workaround for pytest-xdist flaky colletion order |
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.
nitpick: There is a typo here: colletion -> collection
@QuLogic We are setting the option to step testing after the first failure to speed up the tests. |
I've marked this |
I believe this should be working now, once CI catches up. It currently includes #8001 and #8002 as well as several bug fixes that were missed due to the CI not running everything:
|
power-cycled as the code being run on travis (from reading the errors) was not matching the code in the PR. I saw something like this on one of my day-job projects yesterday too. I think the web-hook is firing before the |
It's really only needed to get the pep8 options.
This allows it to work when run via matplotlib.test().
Raising the warning on the current level breaks tests on Python 2.7 which doesn't reset the warning filter correctly.
In python3 `__ne__` automatically delegates to `__eq__`, in python2 it does not and falls back to the default `__ne__` test. The NumPy version of `assert_equal` actually checks `if a != b: raise`, whereas the version of `assert_equal` from `unittest` (where `nose` ultimately pulls from) checks `if not a == b: raise`
This is a problem on Windows where file paths are case-insensitive.
We're good to go here now. |
.travis.yml
Outdated
@@ -225,7 +220,7 @@ after_success: | |||
else | |||
echo "Will only deploy docs build from matplotlib master branch" | |||
fi | |||
if [[ $NOSE_ARGS =~ "--with-coverage" || $USE_PYTEST == true ]]; then | |||
if [[ $USE_PYTEST == true ]]; 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.
We should do this on all runs now?
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 leaving that to #8003, but I see now it doesn't change this condition. @dopplershift Should I turn on coverage for everything here or just leave it for you?
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.
Go ahead and turn it on--I'll rebase on it.
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.
LGTM
The change to pytest will need documenting, but I've opened up a new issue for that at #8015. |
1: There seems to be some slight descrepencies in the number of tests each run finds. |
Adding up those numbers I get 6494 for everything but (6) for which I get 7276. |
And I'm guessing that the extra checks on (6) are PEP8 checks. |
Apparently I can not use a calculator 🐑 |
I'm pre-opening this PR to verify that tests continue to build correctly. However, it still depends on #7935 and #7973.
This PR stops installing nose, and uses pytest everywhere. Note that I did not yet delete any redundant builds. I want to make sure everything works with the different methods first and will then see about pruning stuff.