[Python-checkins] bpo-28655: Fix test bdb for isolate mode (GH-10220)

Victor Stinner webhook-mailer at python.org
Mon Oct 29 16:32:27 EDT 2018


https://github.com/python/cpython/commit/4687bc993a275eaeb27a8b2068b128ce1f464818
commit: 4687bc993a275eaeb27a8b2068b128ce1f464818
branch: 3.6
author: Maite Giménez <mgimenez at dsic.upv.es>
committer: Victor Stinner <vstinner at redhat.com>
date: 2018-10-29T21:32:22+01:00
summary:

bpo-28655: Fix test bdb for isolate mode (GH-10220)

Fix test_bdb when running Python is isolated mode.

(cherry picked from commit c0799ec973530ad2492bb1d6c7287ffc428f0348)

files:
M Lib/test/test_bdb.py

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 gen(a, b):
     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)



More information about the Python-checkins mailing list