Skip to content
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

Add self-check to pytests #5087

Merged
merged 3 commits into from
May 25, 2018
Merged

Add self-check to pytests #5087

merged 3 commits into from
May 25, 2018

Conversation

elazarg
Copy link
Contributor

@elazarg elazarg commented May 20, 2018

Yet another item for #1673.

This PR uses the api for the self-check.

Example of a failed-run output:

~/workspace/mypy$ pytest -n0 -k test_mypy_package
================================ test session starts ================================
platform darwin -- Python 3.6.5, pytest-3.2.5, py-1.5.2, pluggy-0.4.0
rootdir: ~/workspace/mypy, inifile: pytest.ini
plugins: xdist-1.20.1, forked-0.2, cov-2.5.1
collected 6240 items                                                                 

mypy/test/testselfcheck.py F

===================================== FAILURES ======================================
_________________________ SelfCheckSuite.test_mypy_package __________________________
Self check failed
------------------------------- Captured stdout call --------------------------------
mypy/binder.py:254: error: No return value expected
=============================== 6239 tests deselected ===============================
==================== 1 failed, 6239 deselected in 23.75 seconds =====================

$ ./runtests.py self-check results in a similar output, though slightly more verbose, as usual.

@elazarg
Copy link
Contributor Author

elazarg commented May 20, 2018

3.4 fails the type check with this error:

mypy/test/data.py:232: error: "TemporaryDirectory" expects no type arguments, but 1 given

I have no idea why did it pass before. (See short discussion here)

@JelleZijlstra
Copy link
Member

Maybe we just didn't run a self-check with 3.4 before? That error is consistent with the stubs (https://github.com/python/typeshed/blob/master/stdlib/3/tempfile.pyi): TemporaryDirectory is generic only in 3.5+.

@ilevkivskyi
Copy link
Member

I think self check is only run on 3.6. Btw @elazarg I added a new label topic-tests for test related issues.

@elazarg
Copy link
Contributor Author

elazarg commented May 23, 2018

I see. I've changed the name of the self testing from package to self-check so the -x flag doesn't work. Otherwise the checks pass.

Copy link
Collaborator

@ethanhs ethanhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to update the appveyor/travis configs to replace package with self-check if we are going ahead with that.

@elazarg
Copy link
Contributor Author

elazarg commented May 25, 2018

Where's the appveyor check? I've only touched .travis.yml.

@ethanhs
Copy link
Collaborator

ethanhs commented May 25, 2018

@elazarg it is excluded on this line https://github.com/python/mypy/blob/master/appveyor.yml#L24

@elazarg
Copy link
Contributor Author

elazarg commented May 25, 2018

@ethanhs is it OK now?

Copy link
Collaborator

@ethanhs ethanhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI configs look good!

@msullivan msullivan merged commit f639e1b into python:master May 25, 2018
gvanrossum pushed a commit that referenced this pull request Jun 23, 2018
Using the api, similarly to #5087.

stdlibsamples is not included in this PR since it requires special handling of working directory and paths.

This is another item for #1673.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants