You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2022/12/08 22:56:51 UTC

[libcloud] 03/04: Use pytest-timeout pytest plugin and specify timeout for each test run.

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit ff0f239dd9a7222748396099053649c16a289bc6
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Thu Dec 8 23:42:34 2022 +0100

    Use pytest-timeout pytest plugin and specify timeout for each test run.
---
 pytest.ini             | 2 +-
 requirements-tests.txt | 1 +
 tox.ini                | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pytest.ini b/pytest.ini
index 10a4daf35..04583452e 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -3,7 +3,7 @@ python_classes=*Test
 testpaths=libcloud/test
 # Show slowest 10 tests in the output
 # for pytest-xdist, we want to distribute tests by file
-addopts = --durations=10 --dist loadfile
+addopts = --durations=10 --dist loadfile --timeout=15
 # Ignore UserWarning's
 filterwarnings =
     ignore::UserWarning
diff --git a/requirements-tests.txt b/requirements-tests.txt
index addef388c..3f227863f 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -4,6 +4,7 @@ requests>=2.27.1
 requests_mock==1.10.0
 pytest==7.2.0
 pytest-xdist==3.1.0
+pytest-timeout==2.1.0
 pytest-benchmark[histogram]==4.0.0
 cryptography==38.0.4
 
diff --git a/tox.ini b/tox.ini
index 8b211eaca..9573e7d9f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -33,7 +33,7 @@ setenv =
 # NOTE: tee-sys is not supported by pytest which still supports Python 3.5
 # pytest -rsx -vvv -o log_cli=True --durations=10 -n auto --dist loadfile
 commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
-           pytest -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 -n auto --dist loadfile --ignore libcloud/test/benchmarks/ --ignore-glob "*test_list_objects_filtering_performance*"
+           pytest -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 --timeout=15 -n auto --dist loadfile --ignore libcloud/test/benchmarks/ --ignore-glob "*test_list_objects_filtering_performance*"
 
 whitelist_externals = cp
                       bash