Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db45852

Browse files
Workaround: use a different test module name in test_module_resources
1 parent a1106b7 commit db45852

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/test/test_importlib/resources/test_files.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ def test_module_resources(self):
7979
A module can have resources found adjacent to the module.
8080
"""
8181
spec = {
82-
'mod.py': '',
82+
'mod_res.py': '',
8383
'res.txt': 'resources are the best',
8484
}
8585
_path.build(spec, self.site_dir)
86-
import mod
86+
import mod_res
8787

88-
actual = resources.files(mod).joinpath('res.txt').read_text(encoding='utf-8')
89-
assert actual == spec['res.txt']
88+
actual = resources.files(mod_res).joinpath('res.txt').read_text(encoding='utf-8')
89+
self.assertEqual(actual, spec['res.txt'])
9090

9191

9292
class ImplicitContextFilesTests(SiteDir, unittest.TestCase):

0 commit comments

Comments
 (0)