add some guide to run tests in different scopes (#2921)

Introduce ways to run tests in different scopes which should be helpful for beginners.
This commit is contained in:
zhjwpku
2023-10-23 08:17:53 +02:00
committed by GitHub
parent 260ab36f2e
commit cb5f34b721
+7
View File
@@ -43,6 +43,13 @@ After you have all dependencies installed, you can run the various test suites:
# Run the pytest suite in tests/: # Run the pytest suite in tests/:
python setup.py test python setup.py test
# Moreover, you may want to run tests in different scopes for debugging purposes,
# the -s option include print output during test execution.
# Tests in pytest typically follow the pattern: FILEPATH::CLASSNAME::TESTNAME.
pytest -s tests/test_api.py
pytest -s tests/test_api.py::TestRestApiHandler
pytest -s tests/test_api.py::TestRestApiHandler::test_do_GET
# Run the behave (https://behave.readthedocs.io/en/latest/) test suite in features/; # Run the behave (https://behave.readthedocs.io/en/latest/) test suite in features/;
# modify DCS as desired (raft has no dependencies so is the easiest to start with): # modify DCS as desired (raft has no dependencies so is the easiest to start with):
DCS=raft python -m behave DCS=raft python -m behave