diff options
author | Daniel Holth <dholth@fastmail.fm> | 2012-07-07 23:34:12 -0400 |
---|---|---|
committer | Daniel Holth <dholth@fastmail.fm> | 2012-07-07 23:34:12 -0400 |
commit | c62d8121c4660daa4fd6132643b8e98918faf58f (patch) | |
tree | 9abce61ca2df95f974f9465e2851e345037b4995 /setuptools/tests/test_dist_info.py | |
parent | b73bf20cea512d0d95a29db4fd9ed837130c54fc (diff) | |
download | external_python_setuptools-c62d8121c4660daa4fd6132643b8e98918faf58f.tar.gz external_python_setuptools-c62d8121c4660daa4fd6132643b8e98918faf58f.tar.bz2 external_python_setuptools-c62d8121c4660daa4fd6132643b8e98918faf58f.zip |
improve .dist-info test
--HG--
branch : distribute
extra : rebase_source : 23b6b4023d413bf1b27b114687da8736a4b38d8b
Diffstat (limited to 'setuptools/tests/test_dist_info.py')
-rw-r--r-- | setuptools/tests/test_dist_info.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/setuptools/tests/test_dist_info.py b/setuptools/tests/test_dist_info.py index c40886d3..119cc68b 100644 --- a/setuptools/tests/test_dist_info.py +++ b/setuptools/tests/test_dist_info.py @@ -3,6 +3,11 @@ import os, shutil, tempfile, unittest import pkg_resources from pkg_resources import Requirement +try: + import markerlib + has_markerlib = True +except: + has_markerlib = False class TestDistInfo(unittest.TestCase): @@ -11,19 +16,24 @@ class TestDistInfo(unittest.TestCase): for d in pkg_resources.find_distributions(self.tmpdir): dists[d.project_name] = d + assert len(dists) == 2, dists + unversioned = dists['UnversionedDistribution'] versioned = dists['VersionedDistribution'] assert versioned.version == '2.718' # from filename assert unversioned.version == '0.3' # from METADATA - + + @unittest.skipIf(not has_markerlib, + "install markerlib to test conditional dependencies") + def test_conditional_dependencies(self): requires = [Requirement.parse('splort==4'), Requirement.parse('quux>=1.1')] - for d in (unversioned, versioned): + for d in pkg_resources.find_distributions(self.tmpdir): self.assertEquals(d.requires(), requires[:1]) self.assertEquals(d.requires(extras=('baz',)), requires) - self.assertEquals(d.extras, ['baz']) + self.assertEquals(d.extras, ['baz']) def setUp(self): self.tmpdir = tempfile.mkdtemp() |