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