summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-02-27 14:50:01 -0500
committerJason R. Coombs <jaraco@jaraco.com>2021-02-27 14:51:02 -0500
commitce7632f3a75ab8771ec3bc71cf21136a22de55ff (patch)
treefc4965cd0e3c5ef243b20f578b0f66711fe1926f
parent61b3376a257be3e74ac6fa0633cb72dc8a600453 (diff)
downloadpython-setuptools-git-feature/2550-build-from-source.tar.gz
Rely more on pytest param to append markers.feature/2550-build-from-source
-rw-r--r--setuptools/tests/test_virtualenv.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py
index 5a16f529..f13f7997 100644
--- a/setuptools/tests/test_virtualenv.py
+++ b/setuptools/tests/test_virtualenv.py
@@ -2,7 +2,6 @@ import glob
import os
import sys
import itertools
-from collections import UserString
import pathlib
@@ -67,23 +66,19 @@ def _get_pip_versions():
# No network, disable most of these tests
network = False
- def mark_param(orig, *marks):
- result = UserString(orig) if not isinstance(orig, UserString) else orig
- result.marks = getattr(result, 'marks', ()) + marks
- return result
-
- def make_param(marked_param):
- marks = getattr(marked_param, 'marks', ())
- return pytest.param(marked_param, marks=marks)
+ def mark(param, *marks):
+ if not isinstance(param, type(pytest.param(''))):
+ param = pytest.param(param)
+ return param._replace(marks=param.marks + marks)
def skip_network(param):
- return mark_param(param, pytest.mark.skip) if not network else param
+ return param if network else mark(param, pytest.mark.skip(reason="no network"))
network_versions = [
'pip==9.0.3',
'pip==10.0.1',
'pip==18.1',
- mark_param('pip==19.3.1', pytest.mark.xfail(reason='pypa/pip#6599')),
+ mark('pip==19.3.1', pytest.mark.xfail(reason='pypa/pip#6599')),
'pip==20.0.2',
'https://github.com/pypa/pip/archive/master.zip',
]
@@ -93,7 +88,7 @@ def _get_pip_versions():
map(skip_network, network_versions)
)
- return list(map(make_param, versions))
+ return list(versions)
@pytest.mark.parametrize('pip_version', _get_pip_versions())