From cb5f34b72133960d72b748f6076bfc55e9db98d5 Mon Sep 17 00:00:00 2001 From: zhjwpku Date: Mon, 23 Oct 2023 14:17:53 +0800 Subject: [PATCH] add some guide to run tests in different scopes (#2921) Introduce ways to run tests in different scopes which should be helpful for beginners. --- docs/contributing_guidelines.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/contributing_guidelines.rst b/docs/contributing_guidelines.rst index bfa1f4c5..805f2fa8 100644 --- a/docs/contributing_guidelines.rst +++ b/docs/contributing_guidelines.rst @@ -43,6 +43,13 @@ After you have all dependencies installed, you can run the various test suites: # Run the pytest suite in tests/: 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/; # modify DCS as desired (raft has no dependencies so is the easiest to start with): DCS=raft python -m behave