(self)
| 2172 | self.check_roundtrip("'' ''") |
| 2173 | |
| 2174 | def test_random_files(self): |
| 2175 | # Test roundtrip on random python modules. |
| 2176 | # pass the '-ucpu' option to process the full directory. |
| 2177 | |
| 2178 | import glob, random |
| 2179 | tempdir = os.path.dirname(__file__) or os.curdir |
| 2180 | testfiles = glob.glob(os.path.join(glob.escape(tempdir), "test*.py")) |
| 2181 | |
| 2182 | if not support.is_resource_enabled("cpu"): |
| 2183 | testfiles = random.sample(testfiles, 10) |
| 2184 | |
| 2185 | for testfile in testfiles: |
| 2186 | if support.verbose >= 2: |
| 2187 | print('tokenize', testfile) |
| 2188 | with open(testfile, 'rb') as f: |
| 2189 | with self.subTest(file=testfile): |
| 2190 | self.check_roundtrip(f) |
| 2191 | self.check_line_extraction(f) |
| 2192 | |
| 2193 | |
| 2194 | def roundtrip(self, code): |
nothing calls this directly
no test coverage detected