From ae0116356d18ab9116395559cfe4cca69aef384b Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Tue, 8 Oct 2019 14:51:51 +0300 Subject: [PATCH] chore(TCs): mark SLOW tests, when in hurry, +`setup.cfg` ... to adopt pytest args + mark wheel a universal. --- .travis.yml | 2 ++ setup.cfg | 10 ++++++++++ test/test_graphkit.py | 2 ++ test/test_plot.py | 1 + 4 files changed, 15 insertions(+) create mode 100644 setup.cfg diff --git a/.travis.yml b/.travis.yml index cbd8cf82..025017a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ install: script: - pytest -v --cov=graphkit + # In case you adopt -m 'not slow' in setup.cfg. + #- pytest -vm slow --cov=graphkit deploy: provider: pypi diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..2e5ce9fc --- /dev/null +++ b/setup.cfg @@ -0,0 +1,10 @@ +## Python's setup.cfg for tool defaults: +# +[bdist_wheel] +universal = 1 + + +[tool:pytest] +# See http://doc.pytest.org/en/latest/mark.html#mark +markers = + slow: marks tests as slow, select them with `-m slow` or `-m 'not slow'` diff --git a/test/test_graphkit.py b/test/test_graphkit.py index 693addd0..1429c4b2 100644 --- a/test/test_graphkit.py +++ b/test/test_graphkit.py @@ -578,6 +578,7 @@ def count_deletions(steps): assert count_deletions(steps12) != count_deletions(steps22) +@pytest.mark.slow def test_parallel_execution(): import time @@ -633,6 +634,7 @@ def fn3(z, k=1): # make sure results are the same using either method assert result_sequential == result_threaded +@pytest.mark.slow def test_multi_threading(): import time import random diff --git a/test/test_plot.py b/test/test_plot.py index 37b3c211..d17201cb 100644 --- a/test/test_plot.py +++ b/test/test_plot.py @@ -52,6 +52,7 @@ def test_plotting_docstring(): assert ext in network.Network.plot.__doc__ +@pytest.mark.slow def test_plot_formats(pipeline, tmp_path): ## Generate all formats (not needing to save files)