diff options
author | Paul Ganssle <pganssle@users.noreply.github.com> | 2018-10-27 09:48:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-27 09:48:41 -0400 |
commit | 56a7c4436e6370ae369f89cd6cef9294d03af8a2 (patch) | |
tree | 971bf060a540fd54f78bdf3384408deaddb4f9b0 | |
parent | d059e4273d71a012acdbbe1acf4c552e6f5c0793 (diff) | |
parent | ef1442b187c04d8cd06ecd6adcb2c63a06637e73 (diff) | |
download | python-setuptools-git-56a7c4436e6370ae369f89cd6cef9294d03af8a2.tar.gz |
Merge pull request #1531 from madig/skip-tests-to-be-skipped
Mark Py 2/3-only tests as skip instead of xfail
-rw-r--r-- | changelog.d/1531.misc.rst | 1 | ||||
-rw-r--r-- | setuptools/tests/test_build_meta.py | 3 | ||||
-rw-r--r-- | setuptools/tests/test_manifest.py | 3 | ||||
-rw-r--r-- | setuptools/tests/test_namespaces.py | 2 | ||||
-rw-r--r-- | setuptools/tests/test_sdist.py | 2 | ||||
-rw-r--r-- | setuptools/tests/test_test.py | 4 | ||||
-rw-r--r-- | setuptools/tests/test_virtualenv.py | 3 |
7 files changed, 6 insertions, 12 deletions
diff --git a/changelog.d/1531.misc.rst b/changelog.d/1531.misc.rst new file mode 100644 index 00000000..cc51940d --- /dev/null +++ b/changelog.d/1531.misc.rst @@ -0,0 +1 @@ +Converted Python version-specific tests to use ``skipif`` instead of ``xfail``, and removed Python 2.6-specific code from the tests. diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index 7b195e2c..c5f4dcaa 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -7,6 +7,7 @@ import pytest from .files import build_files from .textwrap import DALS +from . import py2_only __metaclass__ = type @@ -143,7 +144,7 @@ def test_prepare_metadata_for_build_wheel(build_backend): assert os.path.isfile(os.path.join(dist_dir, dist_info, 'METADATA')) -@pytest.mark.skipif('sys.version_info > (3,)') +@py2_only def test_prepare_metadata_for_build_wheel_with_str(build_backend): dist_dir = os.path.abspath(str('pip-dist-info')) os.makedirs(dist_dir) diff --git a/setuptools/tests/test_manifest.py b/setuptools/tests/test_manifest.py index c9533dda..5edfbea0 100644 --- a/setuptools/tests/test_manifest.py +++ b/setuptools/tests/test_manifest.py @@ -15,13 +15,12 @@ from setuptools.command.egg_info import FileList, egg_info, translate_pattern from setuptools.dist import Distribution from setuptools.extern import six from setuptools.tests.textwrap import DALS +from . import py3_only import pytest __metaclass__ = type -py3_only = pytest.mark.xfail(six.PY2, reason="Test runs on Python 3 only") - def make_local_path(s): """Converts '/' in a string to os.sep""" diff --git a/setuptools/tests/test_namespaces.py b/setuptools/tests/test_namespaces.py index da19bd79..670ccee9 100644 --- a/setuptools/tests/test_namespaces.py +++ b/setuptools/tests/test_namespaces.py @@ -12,7 +12,7 @@ from setuptools.command import test class TestNamespaces: - @pytest.mark.xfail( + @pytest.mark.skipif( sys.version_info < (3, 5), reason="Requires importlib.util.module_from_spec", ) diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index 02222da5..3a203890 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -20,8 +20,8 @@ from setuptools.command.egg_info import manifest_maker from setuptools.dist import Distribution from setuptools.tests import fail_on_ascii from .text import Filenames +from . import py3_only -py3_only = pytest.mark.xfail(six.PY2, reason="Test runs on Python 3 only") SETUP_ATTRS = { 'name': 'sdist_test', diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py index 960527bc..8d1425e1 100644 --- a/setuptools/tests/test_test.py +++ b/setuptools/tests/test_test.py @@ -93,10 +93,6 @@ def test_test(capfd): assert out == 'Foo\n' -@pytest.mark.xfail( - sys.version_info < (2, 7), - reason="No discover support for unittest on Python 2.6", -) @pytest.mark.usefixtures('tmpdir_cwd', 'quiet_log') def test_tests_are_run_once(capfd): params = dict( diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py index b66a311d..e511c918 100644 --- a/setuptools/tests/test_virtualenv.py +++ b/setuptools/tests/test_virtualenv.py @@ -57,9 +57,6 @@ def test_pip_upgrade_from_source(virtualenv): Check pip can upgrade setuptools from source. """ dist_dir = virtualenv.workspace - if sys.version_info < (2, 7): - # Python 2.6 support was dropped in wheel 0.30.0. - virtualenv.run('pip install -U "wheel<0.30.0"') # Generate source distribution / wheel. virtualenv.run(' && '.join(( 'cd {source}', |