Skip to content

Commit 73fe8cb

Browse files
committed
Use default histfile
1 parent 8b9d218 commit 73fe8cb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Lib/test/test_repl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def test_pythonstartup_success(self):
248248
# errors based on https://github.com/python/cpython/issues/137576
249249
# case 1: error in user input, but PYTHONSTARTUP is fine
250250
startup_code = "print('notice from pythonstartup')"
251-
with new_startup_env(code=startup_code, histfile=".pythonhist") as startup_env:
251+
with new_startup_env(code=startup_code) as startup_env:
252252
# -q to suppress noise
253253
p = spawn_repl("-q", env=os.environ | startup_env, isolated=False)
254254
p.stdin.write("1/0")
@@ -269,7 +269,7 @@ def test_pythonstartup_success(self):
269269
def test_pythonstartup_failure(self):
270270
# case 2: error in PYTHONSTARTUP triggered by user input
271271
startup_code = "def foo():\n 1/0\n"
272-
with new_startup_env(code=startup_code, histfile=".pythonhist") as startup_env:
272+
with new_startup_env(code=startup_code) as startup_env:
273273
# -q to suppress noise
274274
p = spawn_repl("-q", env=os.environ | startup_env, isolated=False)
275275
p.stdin.write("foo()")

t2.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import os
2+
from test.test_repl import new_startup_env, spawn_repl, kill_python
3+
startup_code = "def foo():\n 1/0\n"
4+
with new_startup_env(code=startup_code, histfile=".pythonhist") as startup_env:
5+
# -q to suppress noise
6+
p = spawn_repl("-q", env=os.environ | startup_env, isolated=False)
7+
p.stdin.write("foo()")
8+
print(kill_python(p))

0 commit comments

Comments
 (0)