File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import os
33import unittest
44import sys
5+ from typing import Any
56
67
7- def load_tests (loader , tests , ignorex ):
8+ def load_tests (loader : unittest .TestLoader , tests : unittest .TestSuite , ignorex : Any ) -> unittest .TestSuite :
9+ """Discover and add all reStructuredText (.rst) doctest files within the current directory tree to the test suite.
10+
11+ Parameters
12+ ----------
13+ loader : unittest.TestLoader
14+ The test loader instance used to load the tests.
15+ tests : unittest.TestSuite
16+ The existing test suite to which doctest suites will be added.
17+ ignorex : Any
18+ A placeholder parameter (typically unused) required by the unittest framework.
19+
20+ Returns
21+ -------
22+ unittest.TestSuite
23+ The updated test suite including all discovered .rst doctest files.
24+
25+ Notes
26+ -----
27+ This function is used by the unittest framework to discover and include additional doctests
28+ in the test suite during test discovery.
29+
30+ """
831 for root , dirs , files in os .walk ("." ):
932 for f in files :
1033 if f .endswith (".rst" ):
1134 tests .addTests (
1235 doctest .DocFileSuite (
13- os .path .join (root , f ), optionflags = doctest .ELLIPSIS
36+ os .path .join (root , f ),
37+ optionflags = doctest .ELLIPSIS
1438 )
1539 )
16-
1740 return tests
1841
1942
You can’t perform that action at this time.
0 commit comments