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

Method test_list_paths

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

Source from the content-addressed store, hash-verified

363 raise
364
365 def test_list_paths(self):
366 data = self.run_py(["--list-paths"])
367 found = {}
368 expect = {}
369 for line in data["stdout"].splitlines():
370 m = re.match(r"\s*(.+?)\s+?(\*\s+)?(.+)$", line)
371 if m:
372 found[m.group(1)] = m.group(3)
373 for company in TEST_DATA:
374 company_data = TEST_DATA[company]
375 tags = [t for t in company_data if isinstance(company_data[t], dict)]
376 for tag in tags:
377 arg = f"-V:{company}/{tag}"
378 install = company_data[tag]["InstallPath"]
379 try:
380 expect[arg] = install["ExecutablePath"]
381 try:
382 expect[arg] += " " + install["ExecutableArguments"]
383 except KeyError:
384 pass
385 except KeyError:
386 expect[arg] = str(Path(install[None]) / Path(sys.executable).name)
387
388 expect.pop(f"-V:{company}/ignored", None)
389
390 actual = {k: v for k, v in found.items() if k in expect}
391 try:
392 self.assertDictEqual(expect, actual)
393 except:
394 if support.verbose:
395 print("*** STDOUT ***")
396 print(data["stdout"])
397 raise
398
399 def test_filter_to_company(self):
400 company = "PythonTestSuite"

Callers

nothing calls this directly

Calls 9

PathClass · 0.90
strFunction · 0.85
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