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

ENH Transition to pytest for all testing #325

Closed
drewejohnson opened this issue Jul 27, 2019 · 0 comments · Fixed by #333
Closed

ENH Transition to pytest for all testing #325

drewejohnson opened this issue Jul 27, 2019 · 0 comments · Fixed by #333
Labels
pythonicness testing Related to our test suite
Milestone

Comments

@drewejohnson
Copy link
Collaborator

I propose that, by version 0.8.0, we use pytest as the test runner and wait for a full transition until later.

pytest is a testing framework that has a lot more features than the included unittest that we currently use. Things like parametrization of tests, more granularity with respect to restarting tests, plugins and fixtures [which we may not use]. The main reason that I've found is it's a lot easier to write tests using pytest.

The pytest documentation provides some good reasons for switching over, and they support much of the unittest framework that we already use. If you have pytest installed, you can just run pytest from the project directory and the tests will run. We do have an issue with the naming of one of our helper tests that we use for plotting testPlotAttrs

def testPlotAttrs(testobj, ax=None, xlabel=None, ylabel=None,
xscale=None, yscale=None, legendLabels=None,
title=None):

getting picked up as a test and pytest complaining.

A short term transition would be to instruct the CI to use pytest rather than python setup.py test. This would require no [major] changes to the core of the project. However, I think we would get a lot from a full transition to pytest in the future.

@drewejohnson drewejohnson added pythonicness testing Related to our test suite labels Jul 27, 2019
@drewejohnson drewejohnson added this to the 0.8.0 milestone Jul 27, 2019
drewejohnson added a commit to drewejohnson/serpent-tools that referenced this issue Aug 31, 2019
Closes CORE-GATECH-GROUP#325 in that all testing is done through pytest now. The user
can run pytest from the main project directory where examples,
serpentTools, and tests exists to run all thes tests. The content
of the test has not changed, and should eventually be ported over
to proper pytest, rather than using the unittest class-based approach.

pytest 5.1.2 has been added to requirements-test.txt and is used
in the test script scripts/travis/testScript.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pythonicness testing Related to our test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant