tests: don't test for specific device labels
[pygobject.git] / docs / devguide / building_testing.rst
blob4f4c0758b846868ecd45fd9824389103f0fc343c
1 ==================
2 Building & Testing
3 ==================
5 To pass extra arguments to pytest you can set "PYTEST_ADDOPTS":
7 .. code:: shell
9     # don't hide stdout
10     export PYTEST_ADDOPTS="-s"
11     python3 setup.py test
14 Using Setuptools
15 ----------------
17 .. code:: shell
19     # Build in-tree
20     python3 setup.py build_ext --inplace
22     # Build in-tree including tests
23     python3 setup.py build_tests
25     # Executing some code after the build
26     PYTHONPATH=. python3 foo.py
28     # Running tests
29     python3 setup.py test
31     # To test only a specific file/class/function::
32     TEST_NAMES=test_gi python3 python3 setup.py test
33     TEST_NAMES=test_gi.TestUtf8 python3 setup.py test
34     TEST_NAMES=test_gi.TestUtf8.test_utf8_full_return python3 setup.py test
36     # To display stdout and pytest verbose output:
37     PYGI_TEST_VERBOSE=yes python3 setup.py test
38     # or:
39     python3 setup.py test -s
41     # using pytest directly
42     py.test-3 tests/test_gi.py
44     # Running flake8 tests
45     python3 setup.py quality
47     # Run under gdb
48     python3 setup.py test --gdb
50     # Run under valgrind
51     python3 setup.py test --valgrind --valgrind-log-file=valgrind.log
53     # Create a release tarball for GNOME
54     python3 setup.py sdist_gnome