From: Paul Brossier Date: Thu, 22 Nov 2018 17:41:41 +0000 (+0100) Subject: Merge branch 'master' into feature/pytest X-Git-Tag: 0.4.9~71^2~6 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=e893e6fe954265cd404fd49b4676db50a558d4d0;p=aubio.git Merge branch 'master' into feature/pytest --- e893e6fe954265cd404fd49b4676db50a558d4d0 diff --cc Makefile index 380d3138,0fd02fd1..6a617c3c --- a/Makefile +++ b/Makefile @@@ -243,11 -247,22 +245,22 @@@ coverage: export PYTHONPATH=$(PWD)/pyth coverage: export LD_LIBRARY_PATH=$(PWD)/build/src coverage: force_uninstall_python deps_python \ clean_python clean distclean build local_dylib - lcov --capture --no-external --directory . --output-file build/coverage_lib.info + # capture coverage after running c tests + lcov $(LCOVOPTS) --capture --no-external --directory . \ + --output-file build/coverage_lib.info + # build and test python pip install -v -e . + # run tests, with python coverage - coverage run `which nose2` + coverage run `which pytest` - lcov --capture --no-external --directory . --output-file build/coverage_python.info - lcov -a build/coverage_python.info -a build/coverage_lib.info -o build/coverage.info + # capture coverage again + lcov $(LCOVOPTS) --capture --no-external --directory . \ + --output-file build/coverage_python.info + # merge both coverage info files + lcov $(LCOVOPTS) -a build/coverage_python.info -a build/coverage_lib.info \ + --output-file build/coverage.info + # remove tests + lcov $(LCOVOPTS) --remove build/coverage.info '*/tests/*' '*/ooura_fft8g*' \ + --output-file build/coverage_lib.info # make sure we don't build the doc, which builds a temporary python module coverage_report: export WAFOPTS += --disable-docs diff --cc doc/python_module.rst index 8c3c3776,48e5e54f..cd04f18b --- a/doc/python_module.rst +++ b/doc/python_module.rst @@@ -67,14 -89,14 +89,15 @@@ The command line `aubio` is also instal Python tests ------------ - A number of python tests are provided. To run them, use [pytest] from the - aubio source tree: -A number of Python tests are provided in the `python tests`_. To run them, -install `nose2`_ and run the script ``python/tests/run_all_tests``: ++A number of Python tests are provided in the `python/tests`_ folder. To run ++them, install `pytest`_ and run it from the aubio source directory: + + .. code-block:: console - $ pip install nose2 - $ ./python/tests/run_all_tests ++ $ pip install pytest ++ $ git clone https://git.aubio.org/aubio/aubio + $ cd aubio + $ pytest - Each test script can also be called individually. For instance: - - $ ./python/tests/test_note2midi.py -v - - [pytest]: https://pytest.org -.. _demo_filter.py: https://github.com/aubio/aubio/blob/master/python/demos/demo_filter.py -.. _python tests: https://github.com/aubio/aubio/blob/master/python/tests -.. _nose2: https://github.com/nose-devs/nose2 ++.. _python/tests: https://github.com/aubio/aubio/blob/master/python/tests ++.. _pytest: https://pytest.org