@@ -293,7 +293,7 @@ def skipfile(filename, tested_optional_tags=False, *,
293
293
if filename .endswith ('.rst.txt' ):
294
294
ext = '.rst.txt'
295
295
else :
296
- _ , ext = os .path .splitext (filename )
296
+ _ , ext = os .path .splitext (filename )
297
297
# .rst.txt appear in the installed documentation in subdirectories named "_sources"
298
298
if ext not in ('.py' , '.pyx' , '.pxd' , '.pxi' , '.sage' , '.spyx' , '.rst' , '.tex' , '.rst.txt' ):
299
299
if log :
@@ -629,44 +629,7 @@ def _init_warn_long(self):
629
629
if self .options .long :
630
630
self .options .warn_long = 30.0
631
631
632
- def second_on_modern_computer (self ):
633
- """
634
- Return the wall time equivalent of a second on a modern computer.
635
-
636
- OUTPUT:
637
-
638
- Float. The wall time on your computer that would be equivalent
639
- to one second on a modern computer. Unless you have kick-ass
640
- hardware this should always be >= 1.0. This raises a
641
- :exc:`RuntimeError` if there are no stored timings to use as
642
- benchmark.
643
-
644
- EXAMPLES::
645
-
646
- sage: from sage.doctest.control import DocTestDefaults, DocTestController
647
- sage: DC = DocTestController(DocTestDefaults(), [])
648
- sage: DC.second_on_modern_computer() # not tested
649
- """
650
- from sage .misc .superseded import deprecation
651
- deprecation (32981 , "this method is no longer used by the sage library and will eventually be removed" )
652
-
653
- if len (self .stats ) == 0 :
654
- raise RuntimeError ('no stored timings available' )
655
- success = []
656
- failed = []
657
- for mod in self .stats .values ():
658
- if mod .get ('failed' , False ):
659
- failed .append (mod ['walltime' ])
660
- else :
661
- success .append (mod ['walltime' ])
662
- if len (success ) < 2500 :
663
- raise RuntimeError ('too few successful tests, not using stored timings' )
664
- if len (failed ) > 20 :
665
- raise RuntimeError ('too many failed tests, not using stored timings' )
666
- expected = 12800.0 # Core i7 Quad-Core 2014
667
- return sum (success ) / expected
668
-
669
- def _repr_ (self ):
632
+ def _repr_ (self ) -> str :
670
633
"""
671
634
String representation.
672
635
@@ -1043,7 +1006,8 @@ def expand():
1043
1006
if_installed = self .options .if_installed ):
1044
1007
yield os .path .join (root , file )
1045
1008
elif not skipfile (path , bool (self .options .optional ),
1046
- if_installed = self .options .if_installed , log = self .log ): # log when directly specified filenames are skipped
1009
+ if_installed = self .options .if_installed ,
1010
+ log = self .log ): # log when directly specified filenames are skipped
1047
1011
yield path
1048
1012
self .sources = [FileDocTestSource (path , self .options ) for path in expand ()]
1049
1013
0 commit comments