-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
updates error message to run pytest instead of tests.py standalone #11808
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
@@ -121,7 +121,7 @@ | |||
class NoopTestCommand(TestCommand): | |||
def __init__(self, dist): | |||
print("Matplotlib does not support running tests with " | |||
"'python setup.py test'. Please run 'python tests.py'.") | |||
"'python setup.py test'. Please run '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.
According to the docs you can run the tests with py.test
or python tests.py
.
Should the latter not be the case, one would need to update the docs as well. Else, the error could probably read
Please run 'python tests.py' or 'py.test'.
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 believe there was an attempt to migrate to py.test
, and to deprecate disincentive python tests.py
, in particular the documentation does not mention how to run a single test using python tests.py
. So it seem to me that directly giving the right invocation.
If you look at previous PRs and comment (like https://github.com/matplotlib/matplotlib/pull/8026/files#r101600628), there seem to be some consensus that pytest
is prefered and should replace python tests.py
where possible.
Also
In [1]: import this
...
There should be one-- and preferably only one --obvious way to do 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.
@Carreau all of the pytest CLI args pass through.
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.
ll of the pytest CLI args pass through.
Oh, ok, well the old doc was not saying that, and giving innacurate information.
Thanks for merging. I think that having pytest everywhere but still have the python tests.py
as a alias is great !
Thanks a lot for the contribution @eseiver ! As you may see, I've pushed some changes to your branch as we discussed in person earlier today. I think we've almost done with this pull request. @ivanov has agreed to review it as well. |
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.
This looks great! Thank you for your first contrbution, @eseiver ! I love that we're moving to pytest
with this. Since the tests are passing, I'm happy with this as is. If we want to add a note to test.py
to denote the fact that it is no longer being used, that would help us. Down the line, we'll be removing it altogether, but there's no rush for that.
grumble I still like Would it be better to do |
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.
modulo outcome of pytest
vs python -mpytest
discussion.
@tacaswell how do you feel about nailing this down in a subsequent PR? I think this PR is an improvement and tests look happy so I think we should let @eseiver off the hook for more nuanced testing changes :-) |
This is fine with me. |
ok cool, I'm gonna merge this one! Thanks @eseiver for your first matplotlib commit :-D |
There seem to be a conflict, please backport manually |
PR Summary
updates the error message in
NoopTestCommand
to recommend using pytest instead of tests.pyPR Checklist