diff options
author | Bernát Gábor <bgabor8@bloomberg.net> | 2020-03-08 10:08:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 10:08:01 +0000 |
commit | 54dc9d2cfa7fbca48db8f7ffbabbf90c1884d102 (patch) | |
tree | ac6a4ba36e89e89f4061bbd8990d7c28416cd5cb | |
parent | 895c2a920edc18d79388af7bf068f790c29668b3 (diff) | |
download | virtualenv-54dc9d2cfa7fbca48db8f7ffbabbf90c1884d102.tar.gz |
add timeout for tests (#1700)
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | tests/integration/test_zipapp.py | 1 | ||||
-rw-r--r-- | tests/unit/create/test_creator.py | 1 | ||||
-rw-r--r-- | tests/unit/seed/test_boostrap_link_via_app_data.py | 1 | ||||
-rw-r--r-- | tests/unit/seed/test_extra_install.py | 1 | ||||
-rw-r--r-- | tests/unit/seed/test_pip_invoke.py | 1 | ||||
-rw-r--r-- | tox.ini | 1 |
7 files changed, 7 insertions, 1 deletions
@@ -93,6 +93,7 @@ testing = coverage >= 4.5.1, <6 pytest-mock >= 2.0.0, <3 pytest-env >= 0.6.2, <1 + pytest-timeout >= 1.3.4, <2 xonsh >= 0.9.13, <1; python_version > '3.4' [options.package_data] @@ -114,7 +115,6 @@ formats = gztar universal = true [tool:pytest] -timeout = 200 markers = slow junit_family = xunit2 diff --git a/tests/integration/test_zipapp.py b/tests/integration/test_zipapp.py index 191fd5a..20d4288 100644 --- a/tests/integration/test_zipapp.py +++ b/tests/integration/test_zipapp.py @@ -75,6 +75,7 @@ def call_zipapp(zipapp, monkeypatch, tmp_path, zipapp_test_env, temp_app_data): return _run +@pytest.mark.timeout(timeout=300) def test_zipapp_help(call_zipapp, capsys): call_zipapp("-h") out, err = capsys.readouterr() diff --git a/tests/unit/create/test_creator.py b/tests/unit/create/test_creator.py index bf2de47..a4316ee 100644 --- a/tests/unit/create/test_creator.py +++ b/tests/unit/create/test_creator.py @@ -359,6 +359,7 @@ def test_create_long_path(current_fastest, tmp_path): @pytest.mark.parametrize("creator", set(PythonInfo.current_system().creators().key_to_class) - {"builtin"}) +@pytest.mark.timeout(timeout=30) def test_create_distutils_cfg(creator, tmp_path, monkeypatch): result = cli_run([ensure_text(str(tmp_path / "venv")), "--activators", "", "--creator", creator]) diff --git a/tests/unit/seed/test_boostrap_link_via_app_data.py b/tests/unit/seed/test_boostrap_link_via_app_data.py index 82c49ae..493871d 100644 --- a/tests/unit/seed/test_boostrap_link_via_app_data.py +++ b/tests/unit/seed/test_boostrap_link_via_app_data.py @@ -16,6 +16,7 @@ from virtualenv.util.subprocess import Popen @pytest.mark.slow +@pytest.mark.timeout(timeout=60) @pytest.mark.parametrize("copies", [False, True] if fs_supports_symlink() else [True]) def test_base_bootstrap_link_via_app_data(tmp_path, coverage_env, current_fastest, copies): current = PythonInfo.current_system() diff --git a/tests/unit/seed/test_extra_install.py b/tests/unit/seed/test_extra_install.py index dd3bc23..c5bb462 100644 --- a/tests/unit/seed/test_extra_install.py +++ b/tests/unit/seed/test_extra_install.py @@ -35,6 +35,7 @@ def builtin_shows_marker_missing(): reason="Building C-Extensions requires header files with host python", ) @pytest.mark.parametrize("creator", list(i for i in CREATOR_CLASSES.keys() if i != "builtin")) +@pytest.mark.timeout(timeout=30) def test_can_build_c_extensions(creator, tmp_path, coverage_env): session = cli_run(["--creator", creator, "--seed", "app-data", str(tmp_path), "-vvv"]) coverage_env() diff --git a/tests/unit/seed/test_pip_invoke.py b/tests/unit/seed/test_pip_invoke.py index 6cd7114..745d214 100644 --- a/tests/unit/seed/test_pip_invoke.py +++ b/tests/unit/seed/test_pip_invoke.py @@ -8,6 +8,7 @@ from virtualenv.seed.embed.wheels import BUNDLE_SUPPORT @pytest.mark.slow +@pytest.mark.timeout(timeout=60) def test_base_bootstrap_via_pip_invoke(tmp_path, coverage_env, current_fastest): bundle_ver = BUNDLE_SUPPORT[PythonInfo.current_system().version_release_str] create_cmd = [ @@ -36,6 +36,7 @@ commands = python -m coverage run\ -m pytest \ --junitxml {toxworkdir}/junit.{envname}.xml \ + --timeout 20 \ tests {posargs:--int} python -m coverage combine |