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