File tree Expand file tree Collapse file tree
importlib_resources/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,20 +72,28 @@ def setUp(self):
7272 self .fixtures .enter_context (import_helper .isolated_modules ())
7373
7474
75- class ModulesFilesTests (SiteDir , unittest .TestCase ):
75+ class ModulesFiles :
76+ spec = {
77+ 'mod.py' : '' ,
78+ 'res.txt' : 'resources are the best' ,
79+ }
80+ MODULE = 'unused'
81+
7682 def test_module_resources (self ):
7783 """
7884 A module can have resources found adjacent to the module.
7985 """
80- spec = {
81- 'mod.py' : '' ,
82- 'res.txt' : 'resources are the best' ,
83- }
84- _path .build (spec , self .site_dir )
8586 import mod
8687
8788 actual = resources .files (mod ).joinpath ('res.txt' ).read_text (encoding = 'utf-8' )
88- assert actual == spec ['res.txt' ]
89+ assert actual == self .spec ['res.txt' ]
90+
91+ def load_fixture (self , name ):
92+ self .tree_on_path (self .spec )
93+
94+
95+ class ModuleFilesDiskTests (ModulesFiles , util .DiskSetup , unittest .TestCase ):
96+ pass
8997
9098
9199class ImplicitContextFilesTests (SiteDir , unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments