Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reorder tests to not mess with git blame
  • Loading branch information
johnslavik committed Dec 21, 2025
commit e44213ee0de24038f5c5e2fb0816cb8a779c5df8
16 changes: 8 additions & 8 deletions Lib/test/test_repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,31 +295,31 @@ def bar(x):
expected = "(30, None, [\'def foo(x):\\n\', \' return x + 1\\n\', \'\\n\'], \'<stdin>\')"
self.assertIn(expected, output, expected)

def test_asyncio_repl_respects_isolated_mode(self):
def test_asyncio_repl_reaches_python_startup_script(self):
with os_helper.temp_dir() as tmpdir:
script = os.path.join(tmpdir, "pythonstartup.py")
with open(script, "w") as f:
f.write("print('should not print')\n")
f.write("print('pythonstartup done!')\n")
env = os.environ.copy()
env["PYTHON_HISTORY"] = os.path.join(tmpdir, ".asyncio_history")
env["PYTHONSTARTUP"] = script
p = spawn_asyncio_repl(isolated=True, env=env)
p = spawn_asyncio_repl(env=env)
output = kill_python(p)
self.assertEqual(p.returncode, 0)
self.assertNotIn("should not print", output)
self.assertIn("pythonstartup done!", output)

def test_asyncio_repl_reaches_python_startup_script(self):
def test_asyncio_repl_respects_isolated_mode(self):
with os_helper.temp_dir() as tmpdir:
script = os.path.join(tmpdir, "pythonstartup.py")
with open(script, "w") as f:
f.write("print('pythonstartup done!')\n")
f.write("print('should not print')\n")
env = os.environ.copy()
env["PYTHON_HISTORY"] = os.path.join(tmpdir, ".asyncio_history")
env["PYTHONSTARTUP"] = script
p = spawn_asyncio_repl(env=env)
p = spawn_asyncio_repl(isolated=True, env=env)
output = kill_python(p)
self.assertEqual(p.returncode, 0)
self.assertIn("pythonstartup done!", output)
self.assertNotIn("should not print", output)

@unittest.skipUnless(pty, "requires pty")
def test_asyncio_repl_is_ok(self):
Expand Down
Loading