@@ -145,7 +145,7 @@ def settings_customise_sources(
145145class TestTraversableSupport :
146146 FILENAME = 'example_test_config.json'
147147
148- @pytest .fixture (params = ['importlib_resources' , 'custom' ])
148+ @pytest .fixture (params = ['importlib_resources' , 'custom' , 'custom_with_path' ])
149149 def json_config_path (self , request , tmp_path ):
150150 tests_package_dir = importlib .resources .files ('tests' )
151151
@@ -186,8 +186,14 @@ def name(self):
186186 def joinpath (self , * descendants ):
187187 return CustomTraversable (self ._path .joinpath (* descendants ))
188188
189- custom_traversable = CustomTraversable (tests_package_dir )
190- return custom_traversable / self .FILENAME
189+ if request .param == 'custom' :
190+ custom_traversable = CustomTraversable (tests_package_dir )
191+ return custom_traversable / self .FILENAME
192+
193+ filepath = tmp_path / self .FILENAME
194+ with filepath .open ('w' ) as f :
195+ json .dump ({'foobar' : 'test' }, f )
196+ return CustomTraversable (filepath )
191197
192198 def test_traversable_support (self , json_config_path : Traversable ):
193199 assert json_config_path .is_file ()
0 commit comments