summaryrefslogtreecommitdiff
path: root/pkg_resources/tests
diff options
context:
space:
mode:
authorstepshal <nessento@openmailbox.org>2016-08-20 04:37:32 +0700
committerstepshal <nessento@openmailbox.org>2016-08-20 04:37:32 +0700
commit08511f5fdfe04a8ea6e3ae73e086e8a29a0a5cd1 (patch)
treebf8c8b397156f7fc81b09b43fbbe7435280a75a2 /pkg_resources/tests
parentc296634d44de4a9715d09e4773b73b2d233fbbc4 (diff)
downloadpython-setuptools-git-08511f5fdfe04a8ea6e3ae73e086e8a29a0a5cd1.tar.gz
Fix quantity of blank lines after code object, class of function definition.
Diffstat (limited to 'pkg_resources/tests')
-rw-r--r--pkg_resources/tests/test_markers.py1
-rw-r--r--pkg_resources/tests/test_pkg_resources.py8
-rw-r--r--pkg_resources/tests/test_resources.py4
3 files changed, 12 insertions, 1 deletions
diff --git a/pkg_resources/tests/test_markers.py b/pkg_resources/tests/test_markers.py
index 8d451de3..78810b6e 100644
--- a/pkg_resources/tests/test_markers.py
+++ b/pkg_resources/tests/test_markers.py
@@ -5,6 +5,7 @@ except ImportError:
from pkg_resources import evaluate_marker
+
@mock.patch('platform.python_version', return_value='2.7.10')
def test_ordering(python_version_mock):
assert evaluate_marker("python_full_version > '2.7.3'") is True
diff --git a/pkg_resources/tests/test_pkg_resources.py b/pkg_resources/tests/test_pkg_resources.py
index 8b276ffc..361fe657 100644
--- a/pkg_resources/tests/test_pkg_resources.py
+++ b/pkg_resources/tests/test_pkg_resources.py
@@ -24,6 +24,7 @@ try:
except NameError:
unicode = str
+
def timestamp(dt):
"""
Return a timestamp for a local, naive datetime instance.
@@ -34,13 +35,16 @@ def timestamp(dt):
# Python 3.2 and earlier
return time.mktime(dt.timetuple())
+
class EggRemover(unicode):
+
def __call__(self):
if self in sys.path:
sys.path.remove(self)
if os.path.exists(self):
os.remove(self)
+
class TestZipProvider(object):
finalizers = []
@@ -94,7 +98,9 @@ class TestZipProvider(object):
assert f.read() == 'hello, world!'
manager.cleanup_resources()
+
class TestResourceManager(object):
+
def test_get_cache_path(self):
mgr = pkg_resources.ResourceManager()
path = mgr.get_cache_path('foo')
@@ -107,6 +113,7 @@ class TestIndependence:
"""
Tests to ensure that pkg_resources runs independently from setuptools.
"""
+
def test_setuptools_not_imported(self):
"""
In a separate Python environment, import pkg_resources and assert
@@ -122,7 +129,6 @@ class TestIndependence:
subprocess.check_call(cmd)
-
class TestDeepVersionLookupDistutils(object):
@pytest.fixture
diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py
index 1d663b83..2ed56233 100644
--- a/pkg_resources/tests/test_resources.py
+++ b/pkg_resources/tests/test_resources.py
@@ -34,6 +34,7 @@ class Metadata(pkg_resources.EmptyProvider):
dist_from_fn = pkg_resources.Distribution.from_filename
+
class TestDistro:
def testCollection(self):
@@ -294,6 +295,7 @@ class TestDistro:
class TestWorkingSet:
+
def test_find_conflicting(self):
ws = WorkingSet([])
Foo = Distribution.from_filename("/foo_dir/Foo-1.2.egg")
@@ -380,6 +382,7 @@ class TestEntryPoints:
assert ep.name == 'html+mako'
reject_specs = "foo", "x=a:b:c", "q=x/na", "fez=pish:tush-z", "x=f[a]>2"
+
@pytest.mark.parametrize("reject_spec", reject_specs)
def test_reject_spec(self, reject_spec):
with pytest.raises(ValueError):
@@ -434,6 +437,7 @@ class TestEntryPoints:
with pytest.raises(ValueError):
EntryPoint.parse_map(self.submap_str)
+
class TestRequirements:
def testBasics(self):