1 Star 0 Fork 27

xu_ping/python-werkzeug

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
preserve-any-existing-PYTHONPATH-in-tests.patch 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
xu_ping 提交于 2024-12-05 15:10 . Upgrade version to 3.1.3
From 668b7c6df40795c27ee9d7069a23afaf3a861144 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
Date: Thu, 7 Nov 2024 14:31:40 +0100
Subject: [PATCH] Preserve any existing PYTHONPATH in tests
---
tests/conftest.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/conftest.py b/tests/conftest.py
index f05fd84..a29950e 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -99,6 +99,7 @@ class DevServerClient:
self._log_write = open(log_path, "wb")
self._log_read = open(log_path, encoding="utf8", errors="surrogateescape")
tmp_dir = os.fspath(self._tmp_path)
+ pth_dir = os.pathsep.join((os.getenv("PYTHONPATH"), str(tmp_dir))) if os.getenv("PYTHONPATH") else tmp_dir
self._proc = subprocess.Popen(
[
sys.executable,
@@ -106,7 +107,7 @@ class DevServerClient:
self._app_name,
json.dumps(self._server_kwargs),
],
- env={**os.environ, "PYTHONUNBUFFERED": "1", "PYTHONPATH": tmp_dir},
+ env={**os.environ, "PYTHONUNBUFFERED": "1", "PYTHONPATH": pth_dir},
cwd=tmp_dir,
close_fds=True,
stdout=self._log_write,
--
2.47.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cherry530/python-werkzeug.git
git@gitee.com:cherry530/python-werkzeug.git
cherry530
python-werkzeug
python-werkzeug
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385