Skip to content

Commit bac8d5d

Browse files
committed
Assert adding MIME type with empty extension emits no warning
1 parent ef5cf14 commit bac8d5d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/test/test_mimetypes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,10 @@ def test_add_type_with_undotted_extension_raises_exception(self):
317317
with self.assertRaises(ValueError):
318318
mimetypes.add_type('testing/type', 'undotted')
319319

320-
def test_add_type_with_empty_extension_emits_warning(self):
320+
def test_add_type_with_empty_extension_emits_no_warning(self):
321321
with warnings.catch_warnings(record=True) as wlog:
322322
mimetypes.add_type('testing/type', '')
323-
self.assertEqual(len(wlog), 1)
324-
warning = wlog[0]
325-
self.assertEqual(str(warning.message), 'Empty extension specified')
323+
self.assertEqual(len(wlog), 0)
326324

327325

328326
@unittest.skipUnless(sys.platform.startswith("win"), "Windows only")

0 commit comments

Comments
 (0)