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

Integrate tests with setuptools #26

Open
driesmp opened this issue Mar 1, 2019 · 4 comments
Open

Integrate tests with setuptools #26

driesmp opened this issue Mar 1, 2019 · 4 comments

Comments

@driesmp
Copy link

driesmp commented Mar 1, 2019

Hi,

I noticed that some python programs have the ability to select which tests to run.
Could you elaborate if this is possible with your program?

The test command I'm running is:
python3.6 setup.py test

and something that is of use as example:
python3.6 setup.py test --pytest-args "-k 'not test_integration'"
python3.6 setup.py test -a "--ignore=tests/test_reader.py"

This has the ability to disable tests. Do you know if this is possible?

I noticed that it fails with
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

Could you take a look at https://docs.pytest.org/en/latest/goodpractices.html for integration with setup tools? Thanks!

@driesmp driesmp changed the title Make tests selectable Integrate tests with setuptools Mar 1, 2019
@yboetz
Copy link
Owner

yboetz commented Mar 1, 2019

There are slow and non-slow tests, you can run them directly with pytest using either

pytest -v tests/

to run only the non-slow tests or

pytest -v -m 'slow' tests/

to run the slow ones. I've been following that guide mostly in the setup of my tests, but I don't use pytest with setuptools, so there are no options on what tests to run with setuptools. But just use pytest directly.

@driesmp
Copy link
Author

driesmp commented Mar 1, 2019

Hmmm I see, I ask because FreeBSD's python infrastructure is heavily integrated with setuptools . So if we ever want tests to work on FreeBSD I need to be able to select which ones to run from the setup tools command I showed above ... :(

@yboetz
Copy link
Owner

yboetz commented Mar 1, 2019

Feel free to do a pull request :). I might change this at some point, but at the moment I have other priorities.

@driesmp
Copy link
Author

driesmp commented Mar 1, 2019

Let me see what I can cook up ;)

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

No branches or pull requests

2 participants