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

Run test suite with pytest #9

Merged
merged 1 commit into from
Mar 26, 2019
Merged

Run test suite with pytest #9

merged 1 commit into from
Mar 26, 2019

Conversation

jdufresne
Copy link
Contributor

pytest has better support for parameterized tests. Each test iteration
appears as a separate dot by the test runner and can run in isolation.

@francoisfreitag
Copy link
Contributor

Maybe pytest should be listed as a tests_require dependency in setup.py.

pytest has better support for parameterized tests. Each test iteration
appears as a separate dot by the test runner and can run in isolation.

Reviewed-by: François Freitag
@jdufresne
Copy link
Contributor Author

Maybe pytest should be listed as a tests_require dependency in setup.py.

We don't use python3 setup.py test to run the test suite, so I'm not sure it will be of any practical use. If you think we should be doing this, here are the docs to use run pytest in this way:

https://docs.pytest.org/en/latest/goodpractices.html#integrating-with-setuptools-python-setup-py-test-pytest-runner

But I find the use of setup_requires=["pytest-runner", ... adds unnecessary overhead to every setup.py call as setuptools will need to install pytest-runner before doing anything else. Even for non-test commands. It also seems like unnecessary configuration for a feature we aren't using.

So, I'd prefer to leave this out for now, if it is okay. WDYT?

@francoisfreitag
Copy link
Contributor

The idea of listing pytest as a dependency was mostly for documentation purposes, so that contributors know pytest is required to run the tests. Since the documented command to run tests is tox, I suppose contributors can look at tox.ini and get the dependencies there.

@jdufresne
Copy link
Contributor Author

Just a bit more information, the setuptools developers have discussed potentially deprecating and removing the test integration features in setup.py:

pypa/setuptools#1684
pypa/setuptools#931

@jdufresne jdufresne merged commit 4c9d4ca into erezlife:master Mar 26, 2019
@jdufresne jdufresne deleted the pytest branch March 26, 2019 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants