-
Notifications
You must be signed in to change notification settings - Fork 52
/
python3-tests_with_pythonpath.patch
114 lines (103 loc) · 5.66 KB
/
python3-tests_with_pythonpath.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
diff -urNp -x '*.orig' Python-3.9.2.org/Lib/test/test_asyncio/test_tasks.py Python-3.9.2/Lib/test/test_asyncio/test_tasks.py
--- Python-3.9.2.org/Lib/test/test_asyncio/test_tasks.py 2021-02-19 13:31:44.000000000 +0100
+++ Python-3.9.2/Lib/test/test_asyncio/test_tasks.py 2021-02-25 18:41:41.098779547 +0100
@@ -4,6 +4,7 @@ import collections
import contextvars
import gc
import io
+import os
import random
import re
import sys
@@ -3283,6 +3284,7 @@ class GatherTestsBase:
cb.assert_called_once_with(fut)
self.assertEqual(fut.result(), [3, 1, exc, exc2])
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_env_var_debug(self):
code = '\n'.join((
'import asyncio.coroutines',
diff -urNp -x '*.orig' Python-3.9.2.org/Lib/test/test_cmd_line.py Python-3.9.2/Lib/test/test_cmd_line.py
--- Python-3.9.2.org/Lib/test/test_cmd_line.py 2021-02-19 13:31:44.000000000 +0100
+++ Python-3.9.2/Lib/test/test_cmd_line.py 2021-02-25 18:41:41.098779547 +0100
@@ -265,6 +265,7 @@ class CmdLineTest(unittest.TestCase):
self.assertEqual(rc, 0)
self.assertTrue(data.startswith(b'x'), data)
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_large_PYTHONPATH(self):
path1 = "ABCDE" * 100
path2 = "FGHIJ" * 100
@@ -374,6 +374,7 @@ class CmdLineTest(unittest.TestCase):
@unittest.skipIf(sys.flags.safe_path,
'PYTHONSAFEPATH changes default sys.path')
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_empty_PYTHONPATH_issue16309(self):
# On Posix, it is documented that setting PATH to the
# empty string is equivalent to not setting PATH at all,
--- Python-3.10.6/Lib/test/test_compileall.py.orig 2022-08-21 08:24:26.562151782 +0200
+++ Python-3.10.6/Lib/test/test_compileall.py 2022-08-22 16:36:51.754553471 +0200
@@ -508,6 +508,7 @@ class CommandLineTestsBase:
path = importlib.util.cache_from_source(fn)
self.assertFalse(os.path.exists(path))
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_no_args_compiles_path(self):
# Note that -l is implied for the no args case.
bazfn = script_helper.make_script(self.directory, 'baz', '')
@@ -558,6 +558,7 @@ class CommandLineTestsBase:
@without_source_date_epoch # timestamp invalidation test
@support.requires_resource('cpu')
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_no_args_respects_force_flag(self):
bazfn = script_helper.make_script(self.directory, 'baz', '')
with self.temporary_pycache_prefix() as env:
@@ -577,6 +577,7 @@ class CommandLineTestsBase:
self.assertNotEqual(mtime, mtime2)
@support.requires_resource('cpu')
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_no_args_respects_quiet_flag(self):
script_helper.make_script(self.directory, 'baz', '')
with self.temporary_pycache_prefix() as env:
diff -urNp -x '*.orig' Python-3.9.2.org/Lib/test/test_pydoc/test_pydoc.py Python-3.9.2/Lib/test/test_pydoc/test_pydoc.py
--- Python-3.9.2.org/Lib/test/test_pydoc/test_pydoc.py 2021-02-19 13:31:44.000000000 +0100
+++ Python-3.9.2/Lib/test/test_pydoc/test_pydoc.py 2021-02-25 18:41:41.098779547 +0100
@@ -885,6 +885,7 @@ class PydocImportTest(PydocBaseTest):
self.addCleanup(rmtree, TESTFN)
importlib.invalidate_caches()
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_badimport(self):
# This tests the fix for issue 5230, where if pydoc found the module
# but the module had an internal import error pydoc would report no doc
diff -urNp -x '*.orig' Python-3.9.2.org/Lib/test/test_venv.py Python-3.9.2/Lib/test/test_venv.py
--- Python-3.9.2.org/Lib/test/test_venv.py 2021-02-19 13:31:44.000000000 +0100
+++ Python-3.9.2/Lib/test/test_venv.py 2021-02-25 18:41:41.098779547 +0100
@@ -173,6 +173,7 @@ class BasicTest(BaseTest):
builder.upgrade_dependencies(fake_context)
@requireVenvCreate
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_prefixes(self):
"""
Test that the prefix values are as expected.
@@ -310,6 +311,7 @@ class BasicTest(BaseTest):
# point to the venv being used to run the test, and we lose the link
# to the source build - so Python can't initialise properly.
@requireVenvCreate
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_executable(self):
"""
Test that the sys.executable value is as expected.
@@ -673,6 +673,7 @@ class BasicTest(BaseTest):
self.assertFalse(same_path(path1, path2))
@requireVenvCreate
[email protected]("PYTHONPATH" in os.environ, "$PYTHONPATH set")
class EnsurePipTest(BaseTest):
"""Test venv module installation of pip."""
def assert_pip_not_installed(self):
diff -urNp -x '*.orig' Python-3.9.2.org/Lib/test/test_warnings/__init__.py Python-3.9.2/Lib/test/test_warnings/__init__.py
--- Python-3.9.2.org/Lib/test/test_warnings/__init__.py 2021-02-25 18:41:39.412060338 +0100
+++ Python-3.9.2/Lib/test/test_warnings/__init__.py 2021-02-25 18:41:41.098779547 +0100
@@ -1329,6 +1329,7 @@ class _DeprecatedTest(BaseTest, unittest
class BootstrapTest(unittest.TestCase):
@unittest.skipUnless(support.is_resource_enabled("cmdline"), "python cmdline tests disabled")
+ @unittest.skipIf("PYTHONPATH" in os.environ, "$PYTHONPATH set")
def test_issue_8766(self):
# "import encodings" emits a warning whereas the warnings is not loaded
# or not completely loaded (warnings imports indirectly encodings by