File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
importlib_resources/tests Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -220,13 +220,17 @@ class ResourceFromNamespaceZipTests(
220220 MODULE = 'namespacedata01'
221221
222222
223- class ResourceFromMainModuleWithNoneSpecTests (unittest .TestCase ):
224- # `__main__.__spec__` can be `None` depending on how it is populated.
225- # https://docs.python.org/3/reference/import.html#main-spec
223+ class MainModuleTests (unittest .TestCase ):
226224 def test_main_module_with_none_spec (self ):
225+ """
226+ __main__ module with no spec should raise TypeError (for clarity).
227+
228+ See python/cpython#138531 for details.
229+ """
230+ # construct a __main__ module with no __spec__.
227231 mainmodule = types .ModuleType ("__main__" )
228232
229- self . assertIsNone ( mainmodule .__spec__ )
233+ assert mainmodule .__spec__ is None
230234
231235 with self .assertRaises (
232236 TypeError ,
You can’t perform that action at this time.
0 commit comments