Skip to content

Commit

Permalink
fix pypa#1419 PEP420: cleanup code refactor markers
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Jul 12, 2018
1 parent e1e8659 commit 3c30cf3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
12 changes: 12 additions & 0 deletions setuptools/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,17 @@

import pytest

from setuptools.extern.six import PY2, PY3


__all__ = [
'fail_on_ascii', 'py2_only', 'py3_only'
]


is_ascii = locale.getpreferredencoding() == 'ANSI_X3.4-1968'
fail_on_ascii = pytest.mark.xfail(is_ascii, reason="Test fails in this locale")


py2_only = pytest.mark.skipif(not PY2, reason="Test runs on Python 2 only")
py3_only = pytest.mark.skipif(not PY3, reason="Test runs on Python 3 only")
9 changes: 3 additions & 6 deletions setuptools/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
from mock import patch
from setuptools.dist import Distribution, _Distribution
from setuptools.config import ConfigHandler, read_configuration
from setuptools.extern.six import PY2, PY3

py2_only = pytest.mark.skipif(not PY2, reason="Test runs on Python 2 only")
py3_only = pytest.mark.skipif(not PY3, reason="Test runs on Python 3 only")
from setuptools.tests import py2_only, py3_only

class ErrConfigHandler(ConfigHandler):
"""Erroneous handler. Fails to implement required methods."""
Expand Down Expand Up @@ -610,8 +607,8 @@ def test_find_namespace_directive_fails_on_py2(self, tmpdir):
)

with pytest.raises(DistutilsOptionError):
with get_dist(tmpdir) as dist:
dist.parse_config_files()
with get_dist(tmpdir) as dist:
dist.parse_config_files()

@py3_only
def test_find_namespace_directive(self, tmpdir):
Expand Down
4 changes: 2 additions & 2 deletions setuptools/tests/test_find_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import pytest

from setuptools.tests import py3_only

from setuptools.extern.six import PY3
from setuptools import find_packages

py3_only = pytest.mark.xfail(not PY3, reason="Test runs on Python 3 only")
if PY3:
from setuptools import find_packages_ns

Expand Down

0 comments on commit 3c30cf3

Please sign in to comment.