Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

TST: add script to run tests #49

Merged
merged 3 commits into from
Apr 5, 2020
Merged

TST: add script to run tests #49

merged 3 commits into from
Apr 5, 2020

Conversation

person142
Copy link
Member

Since stubs-only packages have to be installed, add a simple script that installs the stubs and then invokes pytest.

Just a small shortcut for

$ pip install .
$ pytest

Since stubs-only packages have to be installed, add a simple script
that installs the stubs and then invokes pytest.
@person142
Copy link
Member Author

Since this is a small PR I'll merge in a day or so barring complaints.

@rgommers
Copy link
Member

rgommers commented Apr 5, 2020

LGTM, except shouldn't the filename be runtests.py rather than runtests?

@person142
Copy link
Member Author

except shouldn't the filename be runtests.py rather than runtests?

Ah yeah, not good to buck conventions. Changed it.

runtests.py Outdated

def main():
subprocess.run(
['pip', 'install', STUBS_ROOT],
Copy link
Member

Choose a reason for hiding this comment

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

Oh now the more substantial comment: I don't think this works correctly in a virtualenv or conda env. It may install into the base env instead.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm ok, switched it to do [sys.executable, '-m', 'pip', ...]. It seems like if we were trying to do something more complicated we could still run into problems, but since we're just invoking pip we're ok?

Copy link
Member

Choose a reason for hiding this comment

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

That should work I think.

@rgommers rgommers merged commit 2c8d8f2 into numpy:master Apr 5, 2020
@rgommers
Copy link
Member

rgommers commented Apr 5, 2020

Merged, thanks @person142

@person142 person142 deleted the runtests branch April 5, 2020 21:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants