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

Conversation

Projects
None yet
5 participants
@elazarg
Copy link
Contributor

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

JelleZijlstra commented May 20, 2018

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

This comment has been minimized.

Copy link
Collaborator

ilevkivskyi commented May 21, 2018

I think self check is only run on 3.6. Btw @elazarg I added a new label https://github.com/python/mypy/labels/topic-tests for test related issues.

@elazarg

This comment has been minimized.

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.

@ethanhs
Copy link
Collaborator

ethanhs left a comment

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

@elazarg

This comment has been minimized.

Copy link
Contributor Author

elazarg commented May 25, 2018

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

@ethanhs

This comment has been minimized.

Copy link
Collaborator

ethanhs commented May 25, 2018

@elazarg

This comment has been minimized.

Copy link
Contributor Author

elazarg commented May 25, 2018

@ethanhs is it OK now?

@ethanhs
Copy link
Collaborator

ethanhs left a comment

The CI configs look good!

@msullivan msullivan merged commit f639e1b into python:master May 25, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

gvanrossum added a commit that referenced this pull request Jun 23, 2018

move test_stubs and test_samples to pytest (#5142)
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
You can’t perform that action at this time.