MCPcopy Index your code
hub / github.com/python/cpython / test_list

Method test_list

Lib/test/test_launcher.py:340–363  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

338 self.assertEqual(v2, data["SearchInfo.listPaths"])
339
340 def test_list(self):
341 data = self.run_py(["--list"])
342 found = {}
343 expect = {}
344 for line in data["stdout"].splitlines():
345 m = re.match(r"\s*(.+?)\s+?(\*\s+)?(.+)$", line)
346 if m:
347 found[m.group(1)] = m.group(3)
348 for company in TEST_DATA:
349 company_data = TEST_DATA[company]
350 tags = [t for t in company_data if isinstance(company_data[t], dict)]
351 for tag in tags:
352 arg = f"-V:{company}/{tag}"
353 expect[arg] = company_data[tag]["DisplayName"]
354 expect.pop(f"-V:{company}/ignored", None)
355
356 actual = {k: v for k, v in found.items() if k in expect}
357 try:
358 self.assertDictEqual(expect, actual)
359 except:
360 if support.verbose:
361 print("*** STDOUT ***")
362 print(data["stdout"])
363 raise
364
365 def test_list_paths(self):
366 data = self.run_py(["--list-paths"])

Callers

nothing calls this directly

Calls 7

run_pyMethod · 0.80
assertDictEqualMethod · 0.80
splitlinesMethod · 0.45
matchMethod · 0.45
groupMethod · 0.45
popMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected