]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
autoreload_test: Handle a relative PYTHONPATH 3358/head
authorStefano Rivera <stefano@rivera.za.net>
Sun, 21 Jan 2024 19:55:16 +0000 (15:55 -0400)
committerStefano Rivera <stefano@rivera.za.net>
Mon, 22 Jan 2024 15:50:03 +0000 (11:50 -0400)
This came up in the Debian package build of tornado, where we run the
tests from a staged build of the module.

tornado/test/autoreload_test.py

index 5675faa2a58ec7b9c51b43fdb9a336c5a827f58f..d7701c3f5fc43e1e7ba842d42c17ff5d3c92ae3a 100644 (file)
@@ -73,9 +73,13 @@ class AutoreloadTest(unittest.TestCase):
     def run_subprocess(self, args):
         # Make sure the tornado module under test is available to the test
         # application
-        pythonpath = os.getcwd()
+        parts = [os.getcwd()]
         if "PYTHONPATH" in os.environ:
-            pythonpath += os.pathsep + os.environ["PYTHONPATH"]
+            parts += [
+                os.path.join(os.getcwd(), part)
+                for part in os.environ["PYTHONPATH"].split(os.pathsep)
+            ]
+        pythonpath = os.pathsep.join(parts)
 
         p = Popen(
             args,