Skip to content

Travis CI: install typing on python2 to restore some skipped tests #9528

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

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

vbarbaresi
Copy link
Contributor

Description

Fixes #9473

Typing used to be installed on python2 but was removed by this change, I don't know why

in mypy/util.py:try_find_python2_interpreter() we try to find a valid python2 interpreter with typing installed.
If we don't find it, those tests are skipped.

However on typeshed, the CI installs typing on python2 for mypy self test. Thus it doesn't skip the tests.

This caused the regression issue on typeshed

Test Plan

I ran Travis CI on my forked repo.
I based a branch on 3186281 (the one that caused a python2 regression) and was able to reproduce the failing test: https://travis-ci.org/github/vbarbaresi/mypy/jobs/732473410
I noted that this change unskips around 40 tests (all from testpythoneval.py)

This used to be installed but was removed in python@def2c63990dd#diff-354f30a63fb0907d4ad57269548329e3L15
in `mypy/util.py:try_find_python2_interpreter()` we try to find a valid python2 interpreter with typing installed.
If we don't find it, tests are skipped.
However on python/typeshed, the CI installs typing on python2, and thus doesn't skip the tests
This caused the broken tests issue python#9473
@vbarbaresi
Copy link
Contributor Author

I just read in testpythoneval.py:

Note: These test cases are not included in the main test suite, as including
this suite would slow down the main suite too much.

So it looks like this was removed on purpose. Closing.

@vbarbaresi vbarbaresi closed this Oct 3, 2020
@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Oct 3, 2020

Thanks for looking into this and fixing!
I think it might actually have been unintentional, eg since we do run the other pythoneval tests in CI / it's not called out in the PR you linked. I think the comment might be referring to the fact that the evaluation tests are separated out here:

EVALUATION = 'PythonEvaluation'

(edit: just git blamed, and that comment is from 2014, four years apart from the "CI upgrades" PR...)

I'm going to reopen this, and maybe someone else who knows for sure can chime in :-)

@hauntsaninja hauntsaninja reopened this Oct 3, 2020
@JukkaL
Copy link
Collaborator

JukkaL commented Oct 5, 2020

The removal of Python 2 typing seems accidental. It would be nice to run the tests in CI.

@hauntsaninja
Copy link
Collaborator

Great! Thanks again, vbarbaresi

@hauntsaninja hauntsaninja merged commit 2122333 into python:master Oct 6, 2020
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.

Some Python2 tests are skipped in CI
3 participants