Skip to content

Commit

Permalink
autoreload_test: Handle a relative PYTHONPATH
Browse files Browse the repository at this point in the history
This came up in the Debian package build of tornado, where we run the
tests from a staged build of the module.
  • Loading branch information
stefanor committed Jan 22, 2024
1 parent 65a9e48 commit 11b8910
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tornado/test/autoreload_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ def write_files(self, tree, base_path=None):
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,
Expand Down

0 comments on commit 11b8910

Please sign in to comment.