From: Maite Giménez Date: Mon, 29 Oct 2018 20:32:22 +0000 (+0100) Subject: bpo-28655: Fix test bdb for isolate mode (GH-10220) X-Git-Tag: v3.6.8rc1~162 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4687bc993a275eaeb27a8b2068b128ce1f464818;p=thirdparty%2FPython%2Fcpython.git bpo-28655: Fix test bdb for isolate mode (GH-10220) Fix test_bdb when running Python is isolated mode. (cherry picked from commit c0799ec973530ad2492bb1d6c7287ffc428f0348) --- diff --git a/Lib/test/test_bdb.py b/Lib/test/test_bdb.py index a36667869718..616c3a864984 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)