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 hooks for running tests on an installed version of mypy #5898

Merged
merged 3 commits into from
Nov 16, 2018

Conversation

msullivan
Copy link
Collaborator

The main motivation for all of this is to be able to validate
mypy_mypyc wheels.

Because the tests are an integrated subpackage of mypy, I couldn't
figure out a way to run the tests from the source directory against an
installed mypy, and I was reluctant to do a major overhaul of the
source organization, in part because some other projects take
advantage of some of the test infrastructure (mypyc, sqlalchemy-stubs).

So instead we run the tests from where they get installed with the
package. To support this, we allow overriding where the tests look for
test-data using a MYPY_TEST_PREFIX environment variable.

misc/test_installed_version.sh Outdated Show resolved Hide resolved
misc/test_installed_version.sh Outdated Show resolved Hide resolved
mypy/stubgen.py Outdated Show resolved Hide resolved
mypy/test/testcmdline.py Show resolved Hide resolved
The main motivation for all of this is to be able to validate
mypy_mypyc wheels.

Because the tests are an integrated subpackage of mypy, I couldn't
figure out a way to run the tests from the source directory against an
installed mypy, and I was reluctant to do a major overhaul of the
source organization, in part because some other projects take
advantage of some of the test infrastructure (mypyc, sqlalchemy-stubs).

So instead we run the tests from where they get installed with the
package. To support this, we allow overriding where the tests look for
test-data using a `MYPY_TEST_PREFIX` environment variable.
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Also fine to keep venv.

@msullivan msullivan merged commit 3dd2bdf into master Nov 16, 2018
@msullivan msullivan deleted the test-prefix branch November 16, 2018 20:23
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.

2 participants