MCPcopy Create free account
hub / github.com/pytorch/pytorch / __init__

Method __init__

tools/testing/test_run.py:21–46  ·  view source on GitHub ↗
(
        self,
        name: str,
        excluded: Optional[Iterable[str]] = None,
        included: Optional[Iterable[str]] = None,
    )

Source from the content-addressed store, hash-verified

19 _included: Set[str] # If non-empy, only these tests should be run in this test run
20
21 def __init__(
22 self,
23 name: str,
24 excluded: Optional[Iterable[str]] = None,
25 included: Optional[Iterable[str]] = None,
26 ) -> None:
27 self._excluded = set()
28 self._included = set()
29
30 if excluded and included:
31 raise ValueError("Can't specify both included and excluded")
32
33 if "::" in name:
34 assert (
35 not included and not excluded
36 ), "Can't specify included or excluded tests when specifying a test class in the file name"
37 self.test_file, test_class = name.split("::")
38 self._included.add(test_class)
39 else:
40 self.test_file = name
41
42 # For testing purposes
43 if excluded:
44 self._excluded = set(excluded)
45 if included:
46 self._included = set(included)
47
48 @staticmethod
49 def empty() -> "TestRun":

Callers

nothing calls this directly

Calls 2

splitMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected