Change test runner to pytest.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
This commit is contained in:
Chris PeBenito 2023-03-23 09:35:41 -04:00
parent a75656b891
commit 85cac110be
3 changed files with 12 additions and 4 deletions

View File

@ -32,6 +32,7 @@ addition to the development packages from the above list:
To run SETools unit tests, the following packages are required, in To run SETools unit tests, the following packages are required, in
addition to the above dependencies: addition to the above dependencies:
* pytest
* tox (optional) * tox (optional)
### Obtaining SETools ### Obtaining SETools
@ -130,9 +131,11 @@ for up-to-date information on build and install options, respectively.
One goal for SETools is to provide confidence in the validity of the One goal for SETools is to provide confidence in the validity of the
output for the tools. The unit tests for SETools can be run with output for the tools. The unit tests for SETools can be run with
the following command the following commands:
``` ```
$ python setup.py test $ python setup.py build_ext -i
$ pytest tests
``` ```
## Features ## Features

View File

@ -1,3 +1,7 @@
[build-system] [build-system]
requires = ["setuptools", "Cython>=0.27"] requires = ["setuptools", "Cython>=0.27"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
addopts = ["--import-mode=importlib",]
pythonpath = "."

View File

@ -18,7 +18,7 @@ deps = {[testenv]deps}
commands_pre = coverage --version commands_pre = coverage --version
coverage erase coverage erase
{envpython} setup.py build_ext -i {envpython} setup.py build_ext -i
commands = coverage run setup.py test -q commands = coverage run -m pytest tests
coverage report coverage report
[testenv:lint] [testenv:lint]
@ -48,9 +48,10 @@ commands = mypy -p setools
passenv = USERSPACE_SRC passenv = USERSPACE_SRC
deps = networkx>=2.0 deps = networkx>=2.0
cython>=0.27 cython>=0.27
pytest
py36: dataclasses py36: dataclasses
py38: cython>=0.29.14 py38: cython>=0.29.14
py39: networkx>=2.6 py39: networkx>=2.6
py39: cython>=0.29.14 py39: cython>=0.29.14
commands_pre = {envpython} setup.py build_ext -i commands_pre = {envpython} setup.py build_ext -i
commands = {envpython} setup.py test -q commands = pytest tests