diff options
author | Éric Araujo <merwok@netwok.org> | 2011-07-29 00:37:21 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-07-29 00:37:21 (GMT) |
commit | bab50cb1247f79d10a746ec4dae88848319ff162 (patch) | |
tree | 0b7063f0121143132893d16c52141e54ce8eda1d /Lib/packaging/tests/test_database.py | |
parent | 7b0908a8e444d735d459bac7c32566f6f11882fe (diff) | |
download | cpython-bab50cb1247f79d10a746ec4dae88848319ff162.zip cpython-bab50cb1247f79d10a746ec4dae88848319ff162.tar.gz cpython-bab50cb1247f79d10a746ec4dae88848319ff162.tar.bz2 |
Minor packaging cleanup.
- Use shortcut dist.version instead of going through metadata;
- Use %r throughout to display project names and paths.
Diffstat (limited to 'Lib/packaging/tests/test_database.py')
-rw-r--r-- | Lib/packaging/tests/test_database.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/packaging/tests/test_database.py b/Lib/packaging/tests/test_database.py index 3eeda83..119fa23 100644 --- a/Lib/packaging/tests/test_database.py +++ b/Lib/packaging/tests/test_database.py @@ -302,7 +302,7 @@ class TestDatabase(support.LoggingCatcher, self.assertIsInstance(dist, Distribution) if (dist.name in dict(fake_dists) and dist.path.startswith(self.fake_dists_path)): - found_dists.append((dist.name, dist.metadata['version'], )) + found_dists.append((dist.name, dist.version)) else: # check that it doesn't find anything more than this self.assertFalse(dist.path.startswith(self.fake_dists_path)) @@ -323,7 +323,7 @@ class TestDatabase(support.LoggingCatcher, self.assertIsInstance(dist, (Distribution, EggInfoDistribution)) if (dist.name in dict(fake_dists) and dist.path.startswith(self.fake_dists_path)): - found_dists.append((dist.name, dist.metadata['version'])) + found_dists.append((dist.name, dist.version)) else: self.assertFalse(dist.path.startswith(self.fake_dists_path)) @@ -489,17 +489,17 @@ class TestDatabase(support.LoggingCatcher, checkLists([], _yield_distributions(False, False, sys.path)) - found = [(dist.name, dist.metadata['Version']) + found = [(dist.name, dist.version) for dist in _yield_distributions(False, True, sys.path) if dist.path.startswith(self.fake_dists_path)] checkLists(eggs, found) - found = [(dist.name, dist.metadata['Version']) + found = [(dist.name, dist.version) for dist in _yield_distributions(True, False, sys.path) if dist.path.startswith(self.fake_dists_path)] checkLists(dists, found) - found = [(dist.name, dist.metadata['Version']) + found = [(dist.name, dist.version) for dist in _yield_distributions(True, True, sys.path) if dist.path.startswith(self.fake_dists_path)] checkLists(dists + eggs, found) |