Skip to content

Commit e239c9b

Browse files
committed
Remove dependency on packaging when running tests. Ref #47.
1 parent d7f28a7 commit e239c9b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

importlib_metadata/tests/test_api.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import textwrap
33
import unittest
44
import importlib_metadata
5-
import packaging.requirements
65

76
from . import fixtures
87

@@ -103,17 +102,14 @@ def test_files_egg_info(self):
103102

104103
def test_requires(self):
105104
deps = importlib_metadata.requires('egginfo-pkg')
106-
parsed = list(map(packaging.requirements.Requirement, deps))
107-
assert all(parsed)
108105
assert any(
109-
dep.name == 'wheel' and dep.marker
110-
for dep in parsed
106+
dep == 'wheel >= 1.0; python_version >= "2.7"'
107+
for dep in deps
111108
)
112109

113110
def test_requires_dist_info(self):
114-
deps = importlib_metadata.requires('distinfo-pkg')
115-
parsed = list(map(packaging.requirements.Requirement, deps))
116-
assert parsed
111+
deps = list(importlib_metadata.requires('distinfo-pkg'))
112+
assert deps and all(deps)
117113

118114
def test_more_complex_deps_requires_text(self):
119115
requires = textwrap.dedent("""
@@ -145,7 +141,6 @@ def test_more_complex_deps_requires_text(self):
145141
# tightly than some other part of the environment expression.
146142

147143
assert deps == expected
148-
assert all(map(packaging.requirements.Requirement, deps))
149144

150145

151146
class LocalProjectTests(fixtures.LocalPackage, unittest.TestCase):

0 commit comments

Comments
 (0)