(cls)
| 1020 | |
| 1021 | @classmethod |
| 1022 | def files_to_test(cls): |
| 1023 | |
| 1024 | if cls._files_to_test is not None: |
| 1025 | return cls._files_to_test |
| 1026 | |
| 1027 | items = [ |
| 1028 | item.resolve() |
| 1029 | for directory in cls.test_directories |
| 1030 | for item in directory.glob("*.py") |
| 1031 | if not item.name.startswith("bad") |
| 1032 | ] |
| 1033 | |
| 1034 | # Test limited subset of files unless the 'cpu' resource is specified. |
| 1035 | if not test.support.is_resource_enabled("cpu"): |
| 1036 | |
| 1037 | tests_to_run_always = {item for item in items if |
| 1038 | item.name in cls.run_always_files} |
| 1039 | |
| 1040 | items = set(random.sample(items, 10)) |
| 1041 | |
| 1042 | # Make sure that at least tests that heavily use grammar features are |
| 1043 | # always considered in order to reduce the chance of missing something. |
| 1044 | items = list(items | tests_to_run_always) |
| 1045 | |
| 1046 | # bpo-31174: Store the names sample to always test the same files. |
| 1047 | # It prevents false alarms when hunting reference leaks. |
| 1048 | cls._files_to_test = items |
| 1049 | |
| 1050 | return items |
| 1051 | |
| 1052 | def test_files(self): |
| 1053 | with warnings.catch_warnings(): |
no test coverage detected