File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -580,6 +580,18 @@ def test_cache_from_source_respects_pycache_prefix_relative(self):
580580 self .util .cache_from_source (path , optimization = '' ),
581581 os .path .normpath (expect ))
582582
583+ @unittest .skipIf (sys .implementation .cache_tag is None ,
584+ 'requires sys.implementation.cache_tag to not be None' )
585+ def test_cache_from_source_in_root_with_pycache_prefix (self ):
586+ # Regression test for gh-82916
587+ pycache_prefix = os .path .join (os .path .sep , 'tmp' , 'bytecode' )
588+ path = 'qux.py'
589+ expect = os .path .join (os .path .sep , 'tmp' , 'bytecode' ,
590+ f'qux.{ self .tag } .pyc' )
591+ with util .temporary_pycache_prefix (pycache_prefix ):
592+ with os_helper .change_cwd ('/' ):
593+ self .assertEqual (self .util .cache_from_source (path ), expect )
594+
583595 @unittest .skipIf (sys .implementation .cache_tag is None ,
584596 'requires sys.implementation.cache_tag to not be None' )
585597 def test_source_from_cache_inside_pycache_prefix (self ):
You can’t perform that action at this time.
0 commit comments