@@ -202,10 +202,10 @@ def __init__(self):
202
202
def invalidate_caches (self ):
203
203
self .called = True
204
204
205
- cache = {'leave_alone' : object (), 'finder_to_invalidate' : FakeFinder ()}
205
+ cache = {'leave_alone' : object (), '/ finder_to_invalidate' : FakeFinder ()}
206
206
with util .import_state (path_importer_cache = cache ):
207
207
self .machinery .PathFinder .invalidate_caches ()
208
- self .assertTrue (cache ['finder_to_invalidate' ].called )
208
+ self .assertTrue (cache ['/ finder_to_invalidate' ].called )
209
209
210
210
def test_invalidate_caches_clear_out_None (self ):
211
211
# Clear out None in sys.path_importer_cache() when invalidating caches.
@@ -214,6 +214,16 @@ def test_invalidate_caches_clear_out_None(self):
214
214
self .machinery .PathFinder .invalidate_caches ()
215
215
self .assertEqual (len (cache ), 0 )
216
216
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
+
217
227
218
228
class FindModuleTests (FinderTests ):
219
229
def find (self , * args , ** kwargs ):
0 commit comments