From 54f59db7538e0c7d925ca7457490e51567147a7b Mon Sep 17 00:00:00 2001 From: Joris van Rantwijk Date: Wed, 10 Jul 2024 20:18:41 +0200 Subject: [PATCH] Add tox.ini for Python testing --- tox.ini | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tox.ini diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..edbdc00 --- /dev/null +++ b/tox.ini @@ -0,0 +1,50 @@ + +[tox] +skipsdist = true +env_list = + static + coverage + py37 + py38 + py39 + py310 + py311 + py312 + pypy3 + +[testenv] +commands = + python --version + python -m unittest discover -t python -s python/tests + python python/run_matching.py --verify \ + tests/graphs/chain_n1000.edge \ + tests/graphs/chain_n5000.edge \ + tests/graphs/chain_n10000.edge \ + tests/graphs/sparse_delta_n1004.edge \ + tests/graphs/sparse_delta_n2004.edge \ + tests/graphs/sparse_delta_n5004.edge \ + tests/graphs/triangles_n1002.edge \ + tests/graphs/triangles_n5001.edge \ + tests/graphs/triangles_n10002.edge \ + tests/graphs/random_n1000_m10000.edge \ + tests/graphs/random_n2000_m10000.edge \ + tests/graphs/random_n4000_m10000.edge + +[testenv:static] +deps = + mypy + pycodestyle + pylint +commands = + pycodestyle python/mwmatching python/run_matching.py tests + mypy --disallow-incomplete-defs python tests + pylint --ignore=test_algorithm.py python tests/*.py tests/generate/*.py + +[testenv:coverage] +deps = + coverage +commands = + coverage erase + coverage run --branch -m unittest discover -t python -s python/tests + coverage report -m +