summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernát Gábor <bgabor8@bloomberg.net>2020-04-25 17:12:48 +0100
committerGitHub <noreply@github.com>2020-04-25 17:12:48 +0100
commit01b09f6968f64f709e9dfde1903aeb7e0f994b4e (patch)
treeef768984f308c3ec4f3da9a828b98a533d45983a
parentc2a37fdb7325d414a7f2b7ec7a41bf8724d85358 (diff)
downloadvirtualenv-01b09f6968f64f709e9dfde1903aeb7e0f994b4e.tar.gz
Run test suite in parallel (#1786)
-rw-r--r--azure-pipelines.yml2
-rw-r--r--setup.cfg21
-rw-r--r--tests/integration/test_zipapp.py1
-rw-r--r--tests/unit/seed/test_boostrap_link_via_app_data.py2
-rw-r--r--tests/unit/seed/test_pip_invoke.py1
-rw-r--r--tox.ini22
6 files changed, 24 insertions, 25 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index c48691a..9315a35 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -28,7 +28,7 @@ schedules:
always: true
variables:
- PYTEST_ADDOPTS: "-vv --durations=10"
+ PYTEST_ADDOPTS: "-vv --durations=20"
CI_RUN: 'yes'
UPGRADE_ADVISORY: 'yes'
diff --git a/setup.cfg b/setup.cfg
index 4715417..7c4d34f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -83,19 +83,20 @@ virtualenv.seed =
[options.extras_require]
docs =
- sphinx >= 2.0.0, < 3
- sphinx-argparse >= 0.2.5, <1
- sphinx-rtd-theme >= 0.4.3, <1
+ sphinx >= 3
+ sphinx-argparse >= 0.2.5
+ sphinx-rtd-theme >= 0.4.3
towncrier >= 19.9.0rc1
- proselint >= 0.10.2, <1
+ proselint >= 0.10.2
testing =
packaging>=20.0;python_version>"3.4"
- pytest >= 4.0.0, <6
- 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.16, <1; python_version > '3.4'
+ pytest >= 4
+ coverage >= 5
+ coverage_enable_subprocess >= 1
+ pytest-xdist >= 1.31.0
+ pytest-mock >= 2
+ pytest-env >= 0.6.2
+ xonsh >= 0.9.16; python_version > '3.4'
[options.package_data]
virtualenv.activation.bash = *.sh
diff --git a/tests/integration/test_zipapp.py b/tests/integration/test_zipapp.py
index 20d4288..191fd5a 100644
--- a/tests/integration/test_zipapp.py
+++ b/tests/integration/test_zipapp.py
@@ -75,7 +75,6 @@ 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/seed/test_boostrap_link_via_app_data.py b/tests/unit/seed/test_boostrap_link_via_app_data.py
index 09e4dce..a95f4aa 100644
--- a/tests/unit/seed/test_boostrap_link_via_app_data.py
+++ b/tests/unit/seed/test_boostrap_link_via_app_data.py
@@ -16,7 +16,6 @@ from virtualenv.util.subprocess import Popen
@pytest.mark.slow
-@pytest.mark.timeout(timeout=120)
@pytest.mark.parametrize("copies", [False, True] if fs_supports_symlink() else [True])
def test_seed_link_via_app_data(tmp_path, coverage_env, current_fastest, copies):
current = PythonInfo.current_system()
@@ -125,7 +124,6 @@ def test_base_bootstrap_link_via_app_data_not_writable(tmp_path, current_fastest
@pytest.mark.slow
-@pytest.mark.timeout(timeout=60)
@pytest.mark.parametrize("pkg", ["pip", "setuptools", "wheel"])
def test_base_bootstrap_link_via_app_data_no(tmp_path, coverage_env, current_fastest, session_app_data, pkg):
create_cmd = [str(tmp_path), "--seeder", "app-data", "--no-{}".format(pkg)]
diff --git a/tests/unit/seed/test_pip_invoke.py b/tests/unit/seed/test_pip_invoke.py
index b750753..300e09a 100644
--- a/tests/unit/seed/test_pip_invoke.py
+++ b/tests/unit/seed/test_pip_invoke.py
@@ -8,7 +8,6 @@ from virtualenv.seed.embed.wheels import BUNDLE_SUPPORT
@pytest.mark.slow
-@pytest.mark.timeout(timeout=60)
@pytest.mark.parametrize("no", ["pip", "setuptools", "wheel", ""])
def test_base_bootstrap_via_pip_invoke(tmp_path, coverage_env, current_fastest, no):
bundle_ver = BUNDLE_SUPPORT[PythonInfo.current_system().version_release_str]
diff --git a/tox.ini b/tox.ini
index 9b580b7..3a2dd60 100644
--- a/tox.ini
+++ b/tox.ini
@@ -25,22 +25,24 @@ setenv =
COVERAGE_PROCESS_START = {toxinidir}/.coveragerc
_COVERAGE_SRC = {envsitepackagesdir}/virtualenv
PYTHONIOENCODING=utf-8
- PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
+ {py34,py27,pypy}: PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
passenv = https_proxy http_proxy no_proxy HOME PYTEST_* PIP_* CI_RUN TERM
extras = testing
install_command = python -m pip install {opts} {packages} --disable-pip-version-check
commands =
- python -c 'from os.path import sep; file = open(r"{envsitepackagesdir}\{\}coverage-virtualenv.pth".format(sep), "w"); file.write("import coverage; coverage.process_startup()"); file.close()'
- python -m coverage erase
-
- python -m coverage run\
- -m pytest \
+ coverage erase
+ coverage run -m pytest \
--junitxml {toxworkdir}/junit.{envname}.xml \
- --timeout 30 \
- tests {posargs:--int}
+ tests {posargs:--int -n {env:PYTEST_XDIST:auto}}
- python -m coverage combine
- python -m coverage report
+ coverage combine
+ coverage report
+ coverage html -d {envtmpdir}/htmlcov
+
+[testenv:pypy]
+setenv =
+ {[testenv]setenv}
+ PYTEST_XDIST = 0
[testenv:coverage]
description = [run locally after tests]: combine coverage data and create report;