Skip to content

Commit e4351c2

Browse files
committed
Add a new test capturing the new expectation.
1 parent 5a65705 commit e4351c2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ def test_valid_dists_preferred(self):
155155
dist = Distribution.from_name('foo')
156156
assert dist.version == "1.0"
157157

158+
def test_missing_metadata(self):
159+
"""
160+
Dists with a missing metadata file should return None.
161+
162+
Ref python/importlib_metadata#493.
163+
"""
164+
fixtures.build_files(self.make_pkg('foo-4.3', files={}), self.site_dir)
165+
assert Distribution.from_name('foo').metadata is None
166+
assert metadata('foo') is None
167+
158168

159169
class NonASCIITests(fixtures.OnSysPath, fixtures.SiteDir, unittest.TestCase):
160170
@staticmethod

0 commit comments

Comments
 (0)