@@ -202,10 +202,10 @@ def __init__(self):
202202 def invalidate_caches (self ):
203203 self .called = True
204204
205- cache = {'leave_alone' : object (), 'finder_to_invalidate' : FakeFinder ()}
205+ cache = {'leave_alone' : object (), '/ finder_to_invalidate' : FakeFinder ()}
206206 with util .import_state (path_importer_cache = cache ):
207207 self .machinery .PathFinder .invalidate_caches ()
208- self .assertTrue (cache ['finder_to_invalidate' ].called )
208+ self .assertTrue (cache ['/ finder_to_invalidate' ].called )
209209
210210 def test_invalidate_caches_clear_out_None (self ):
211211 # Clear out None in sys.path_importer_cache() when invalidating caches.
@@ -214,6 +214,16 @@ def test_invalidate_caches_clear_out_None(self):
214214 self .machinery .PathFinder .invalidate_caches ()
215215 self .assertEqual (len (cache ), 0 )
216216
217+ def test_invalidate_caches_clear_out_relative_path (self ):
218+ class FakeFinder :
219+ def invalidate_caches (self ):
220+ pass
221+
222+ cache = {'relative_path' : FakeFinder ()}
223+ with util .import_state (path_importer_cache = cache ):
224+ self .machinery .PathFinder .invalidate_caches ()
225+ self .assertEqual (cache , {})
226+
217227
218228class FindModuleTests (FinderTests ):
219229 def find (self , * args , ** kwargs ):
0 commit comments