This repository has been archived by the owner on Dec 1, 2021. It is now read-only.
Adding support for pytest with tox for single test file #714
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Often when we develop one python module in blueoil, to run unit testing we've to use
pytest' on entire
testsdirectory. This is time consuming. A simpler and efficient way to test only one
test_file` is needed in blueoil to run unit testing for one test file.Description
Blueoil use
tox
to run theunit testing
with proper environment setup. For python files test the commandtox -e pytest
is used from inside theblueoil/lmnet
directory. But often we need to run one test file which is under development without wasting time to run fullpytest
unit testing on entiretests
directory. This modification totox.ini
file add a commandpytest-only
which takes a command line argument and pass it on the thetox
command. By this way we can run unit testing on a single python test file usingtox
.Above command will load the python test environment and configuration and run the provided python test file via command line argument.
How has this been tested?
tox -e pytest-only {path/to/single/test_file.py}
Screenshots (if appropriate):
Types of changes
Checklist: