Commit d3215c10 authored by Nikolaus Waxweiler's avatar Nikolaus Waxweiler

Mark Py 2/3-only tests as skip instead of xfail

Also reuse pre-defined py2_only and py3_only decorators where
appropriate.
parent 1fb56a31
......@@ -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)
......
......@@ -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"""
......
......@@ -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",
)
......
......@@ -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',
......
......@@ -93,7 +93,7 @@ def test_test(capfd):
assert out == 'Foo\n'
@pytest.mark.xfail(
@pytest.mark.skipif(
sys.version_info < (2, 7),
reason="No discover support for unittest on Python 2.6",
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment