@@ -359,47 +359,12 @@ def test_cache_from_source_no_dot(self):
359359 self .assertEqual (self .util .cache_from_source (path , optimization = '' ),
360360 expect )
361361
362- def test_cache_from_source_debug_override (self ):
363- # Given the path to a .py file, return the path to its PEP 3147/PEP 488
364- # defined .pyc file (i.e. under __pycache__).
365- path = os .path .join ('foo' , 'bar' , 'baz' , 'qux.py' )
366- with warnings .catch_warnings ():
367- warnings .simplefilter ('ignore' )
368- self .assertEqual (self .util .cache_from_source (path , False ),
369- self .util .cache_from_source (path , optimization = 1 ))
370- self .assertEqual (self .util .cache_from_source (path , True ),
371- self .util .cache_from_source (path , optimization = '' ))
372- with warnings .catch_warnings ():
373- warnings .simplefilter ('error' )
374- with self .assertRaises (DeprecationWarning ):
375- self .util .cache_from_source (path , False )
376- with self .assertRaises (DeprecationWarning ):
377- self .util .cache_from_source (path , True )
378-
379362 def test_cache_from_source_cwd (self ):
380363 path = 'foo.py'
381364 expect = os .path .join ('__pycache__' , 'foo.{}.pyc' .format (self .tag ))
382365 self .assertEqual (self .util .cache_from_source (path , optimization = '' ),
383366 expect )
384367
385- def test_cache_from_source_override (self ):
386- # When debug_override is not None, it can be any true-ish or false-ish
387- # value.
388- path = os .path .join ('foo' , 'bar' , 'baz.py' )
389- # However if the bool-ishness can't be determined, the exception
390- # propagates.
391- class Bearish :
392- def __bool__ (self ): raise RuntimeError
393- with warnings .catch_warnings ():
394- warnings .simplefilter ('ignore' )
395- self .assertEqual (self .util .cache_from_source (path , []),
396- self .util .cache_from_source (path , optimization = 1 ))
397- self .assertEqual (self .util .cache_from_source (path , [17 ]),
398- self .util .cache_from_source (path , optimization = '' ))
399- with self .assertRaises (RuntimeError ):
400- self .util .cache_from_source ('/foo/bar/baz.py' , Bearish ())
401-
402-
403368 def test_cache_from_source_optimization_empty_string (self ):
404369 # Setting 'optimization' to '' leads to no optimization tag (PEP 488).
405370 path = 'foo.py'
0 commit comments