From 4687bc993a275eaeb27a8b2068b128ce1f464818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maite=20Gim=C3=A9nez?= Date: Mon, 29 Oct 2018 21:32:22 +0100 Subject: bpo-28655: Fix test bdb for isolate mode (GH-10220) Fix test_bdb when running Python is isolated mode. (cherry picked from commit c0799ec973530ad2492bb1d6c7287ffc428f0348) --- Lib/test/test_bdb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_bdb.py b/Lib/test/test_bdb.py index a366678..616c3a8 100644 --- a/Lib/test/test_bdb.py +++ b/Lib/test/test_bdb.py @@ -526,13 +526,13 @@ def run_test(modules, set_list, skip=None): test.id = lambda : None test.expect_set = list(gen(repeat(()), iter(sl))) with create_modules(modules): - sys.path.append(os.getcwd()) with TracerRun(test, skip=skip) as tracer: tracer.runcall(tfunc_import) @contextmanager def create_modules(modules): with test.support.temp_cwd(): + sys.path.append(os.getcwd()) try: for m in modules: fname = m + '.py' @@ -544,6 +544,7 @@ def create_modules(modules): finally: for m in modules: test.support.forget(m) + sys.path.pop() def break_in_func(funcname, fname=__file__, temporary=False, cond=None): return 'break', (fname, None, temporary, cond, funcname) -- cgit v0.12