mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-07 02:10:27 +00:00
update test_cmd_line to ignore CosmoImporter
test_cmd_line did not consider that sys.meta_path would have a different starting entry, and so what would happen in the isolated mode test is that CosmoImporter would pick up uuid.pyc from the zip store, and claim no errors in both cases. Now the test removes CosmoImporter from sys.meta_path and so the expected behavior occurs again.
This commit is contained in:
parent
4aeaa5a181
commit
49074cfdbf
1 changed files with 4 additions and 0 deletions
4
third_party/python/Lib/test/test_cmd_line.py
vendored
4
third_party/python/Lib/test/test_cmd_line.py
vendored
|
@ -483,6 +483,10 @@ class CmdLineTest(unittest.TestCase):
|
|||
with open(fake, "w") as f:
|
||||
f.write("raise RuntimeError('isolated mode test')\n")
|
||||
with open(main, "w") as f:
|
||||
f.write("import sys\n")
|
||||
f.write("import _imp\n")
|
||||
f.write("if sys.meta_path[0] == _imp.CosmoImporter:\n")
|
||||
f.write("\tsys.meta_path.pop(0)\n")
|
||||
f.write("import uuid\n")
|
||||
f.write("print('ok')\n")
|
||||
self.assertRaises(subprocess.CalledProcessError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue