forked from pool/python-Werkzeug
- Replace no-network-testing.patch with the upstream solution
2402-dev_server.patch from gh#pallets/werkzeug#2402. - Add moved_root.patch to make test test_exclude_patterns with different PYTHONPATH. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Werkzeug?expand=0&rev=64
This commit is contained in:
34
moved_root.patch
Normal file
34
moved_root.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
tests/test_serving.py | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/tests/test_serving.py
|
||||
+++ b/tests/test_serving.py
|
||||
@@ -10,6 +10,7 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
+import werkzeug
|
||||
from werkzeug import run_simple
|
||||
from werkzeug._reloader import _find_stat_paths
|
||||
from werkzeug._reloader import _find_watchdog_paths
|
||||
@@ -127,12 +128,15 @@ def test_windows_get_args_for_reloading(
|
||||
|
||||
@pytest.mark.parametrize("find", [_find_stat_paths, _find_watchdog_paths])
|
||||
def test_exclude_patterns(find):
|
||||
- # Imported paths under sys.prefix will be included by default.
|
||||
+ # Don’t use sys.prefix, we may have redefined PYTHONPATH and
|
||||
+ # libraries elsewhere.
|
||||
+ cur_prefix = str(Path(werkzeug.__file__).parents[1])
|
||||
+ # Imported paths under cur_prefix will be included by default.
|
||||
paths = find(set(), set())
|
||||
- assert any(p.startswith(sys.prefix) for p in paths)
|
||||
+ assert any(p.startswith(cur_prefix) for p in paths)
|
||||
# Those paths should be excluded due to the pattern.
|
||||
- paths = find(set(), {f"{sys.prefix}*"})
|
||||
- assert not any(p.startswith(sys.prefix) for p in paths)
|
||||
+ paths = find(set(), {f"{str(cur_prefix)}*"})
|
||||
+ assert not any(p.startswith(cur_prefix) for p in paths)
|
||||
|
||||
|
||||
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
|
||||
Reference in New Issue
Block a user