python/elasticsearch: update to 8.16.0
[oi-userland.git] / components / python / nose / patches / 02-test-fixes.patch
blobc1e9e72a3fbe4441871789ac59967fec19813a3a
1 --- nose-1.3.7/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst.orig
2 +++ nose-1.3.7/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst
3 @@ -18,7 +18,7 @@
4 >>> from nose.plugins.manager import RestrictedPluginManager
5 >>> class StartPlugin(Plugin):
6 ... def startTest(self, test):
7 - ... print "started %s" % test
8 + ... print("started %s" % test)
10 .. Note ::
12 --- nose-1.3.7/functional_tests/test_withid_failures.rst.orig
13 +++ nose-1.3.7/functional_tests/test_withid_failures.rst
14 @@ -7,16 +7,16 @@
15 >>> support = os.path.join(os.path.dirname(__file__), 'support', 'id_fails')
16 >>> argv = [__file__, '-v', '--with-id', '--id-file', idfile, support]
17 >>> run(argv=argv, plugins=[TestId()]) # doctest: +ELLIPSIS
18 - #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR
19 + #1 Failure: ModuleNotFoundError (No module named ...apackagethatdoesntexist...) ... ERROR
20 #2 test_b.test ... ok
21 #3 test_b.test_fail ... FAIL
22 <BLANKLINE>
23 ======================================================================
24 - ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
25 + ERROR: Failure: ModuleNotFoundError (No module named ...apackagethatdoesntexist...)
26 ----------------------------------------------------------------------
27 Traceback (most recent call last):
28 ...
29 - ImportError: No module ...apackagethatdoesntexist...
30 + ModuleNotFoundError: No module named ...apackagethatdoesntexist...
31 <BLANKLINE>
32 ======================================================================
33 FAIL: test_b.test_fail
34 @@ -35,14 +35,14 @@
35 >>> argv.append('1')
36 >>> _junk = sys.modules.pop('test_a', None) # 2.3 requires
37 >>> run(argv=argv, plugins=[TestId()]) #doctest: +ELLIPSIS
38 - #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR
39 + #1 Failure: ModuleNotFoundError (No module named ...apackagethatdoesntexist...) ... ERROR
40 <BLANKLINE>
41 ======================================================================
42 - ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
43 + ERROR: Failure: ModuleNotFoundError (No module named ...apackagethatdoesntexist...)
44 ----------------------------------------------------------------------
45 Traceback (most recent call last):
46 ...
47 - ImportError: No module ...apackagethatdoesntexist...
48 + ModuleNotFoundError: No module named ...apackagethatdoesntexist...
49 <BLANKLINE>
50 ----------------------------------------------------------------------
51 Ran 1 test in ...s
52 --- nose-1.3.7/functional_tests/doc_tests/test_selector_plugin/selector_plugin.rst.orig
53 +++ nose-1.3.7/functional_tests/doc_tests/test_selector_plugin/selector_plugin.rst
54 @@ -19,7 +19,7 @@
55 package and associated tests, laid out like this::
57 >>> from nose.util import ls_tree
58 - >>> print ls_tree(support)
59 + >>> print(ls_tree(support))
60 |-- mymodule.py
61 |-- mypackage
62 | |-- __init__.py
63 --- nose-1.3.7/functional_tests/doc_tests/test_issue145/imported_tests.rst.orig
64 +++ nose-1.3.7/functional_tests/doc_tests/test_issue145/imported_tests.rst
65 @@ -11,7 +11,7 @@
66 >>> import os
67 >>> support = os.path.join(os.path.dirname(__file__), 'support')
68 >>> from nose.util import ls_tree
69 - >>> print ls_tree(support) # doctest: +REPORT_NDIFF
70 + >>> print(ls_tree(support)) # doctest: +REPORT_NDIFF
71 |-- package1
72 | |-- __init__.py
73 | `-- test_module.py
74 --- nose-1.3.7/unit_tests/test_doctest_munging.rst.orig
75 +++ nose-1.3.7/unit_tests/test_doctest_munging.rst
76 @@ -28,13 +28,13 @@
77 the example should raise an exception!
79 >>> from nose.plugins.plugintest import remove_stack_traces
80 - >>> print remove_stack_traces("""\
81 + >>> print(remove_stack_traces("""\
82 ... Ceci n'est pas une traceback.
83 ... Traceback (most recent call last):
84 ... File "/some/dir/foomodule.py", line 15, in runTest
85 ... File "/some/dir/spam.py", line 293, in who_knows_what
86 ... AssertionError: something bad happened
87 - ... """)
88 + ... """))
89 Ceci n'est pas une traceback.
90 Traceback (most recent call last):
91 ...
92 @@ -44,7 +44,7 @@
93 Multiple tracebacks in an example are all replaced, as long as they're
94 separated by blank lines.
96 - >>> print remove_stack_traces("""\
97 + >>> print(remove_stack_traces("""\
98 ... Ceci n'est pas une traceback.
99 ... Traceback (most recent call last):
100 ... File spam
101 @@ -53,7 +53,7 @@
102 ... Traceback (most recent call last):
103 ... File eggs
104 ... AttributeError: spam
105 - ... """)
106 + ... """))
107 Ceci n'est pas une traceback.
108 Traceback (most recent call last):
110 @@ -70,7 +70,7 @@
111 trailing blank lines.
113 >>> from nose.plugins.plugintest import munge_nose_output_for_doctest
114 - >>> print munge_nose_output_for_doctest("""\
115 + >>> print(munge_nose_output_for_doctest("""\
116 ... runTest (foomodule.PassingTest) ... ok
117 ... runTest (foomodule.FailingTest) ... FAIL
119 @@ -88,7 +88,7 @@
120 ... FAILED (failures=1)
123 - ... """)
124 + ... """))
125 runTest (foomodule.PassingTest) ... ok
126 runTest (foomodule.FailingTest) ... FAIL
127 <BLANKLINE>
128 --- nose-1.3.7/unit_tests/test_config_defaults.rst.orig
129 +++ nose-1.3.7/unit_tests/test_config_defaults.rst
130 @@ -1,6 +1,6 @@
131 >>> from optparse import OptionParser
132 >>> import os
133 - >>> from cStringIO import StringIO
134 + >>> from io import StringIO
136 >>> import nose.config
138 @@ -12,7 +12,7 @@
139 ... "config_defaults")
141 >>> def error(msg):
142 - ... print "error: %s" % msg
143 + ... print("error: %s" % msg)
145 >>> def get_parser():
146 ... parser = OptionParser()
147 @@ -129,18 +129,18 @@
148 (filename)
150 >>> options, args = parse([], os.path.join(support, "nonexistent.cfg"))
151 - >>> print options.__dict__
152 + >>> print(options.__dict__)
153 {'verbosity': 1}
155 (filenames)
157 >>> options, args = parse([], [os.path.join(support, "nonexistent.cfg")])
158 - >>> print options.__dict__
159 + >>> print(options.__dict__)
160 {'verbosity': 1}
163 The same goes for missing config file section ("nosetests")
165 >>> options, args = parse([], StringIO("[spam]\nfoo=bar\n"))
166 - >>> print options.__dict__
167 + >>> print(options.__dict__)
168 {'verbosity': 1}
169 --- nose-1.3.7/functional_tests/doc_tests/test_init_plugin/init_plugin.rst.orig
170 +++ nose-1.3.7/functional_tests/doc_tests/test_init_plugin/init_plugin.rst
171 @@ -130,7 +130,7 @@
172 ... def begin(self):
173 ... ConfigurableWidget.cfg = self.cfg
174 ... def load_config(self, path):
175 - ... from ConfigParser import ConfigParser
176 + ... from configparser import ConfigParser
177 ... p = ConfigParser()
178 ... p.read([path])
179 ... self.cfg = dict(p.items('DEFAULT'))
180 --- nose-1.3.7/functional_tests/doc_tests/test_issue097/plugintest_environment.rst.orig
181 +++ nose-1.3.7/functional_tests/doc_tests/test_issue097/plugintest_environment.rst
182 @@ -29,7 +29,7 @@
183 ... self.conf = conf
185 ... def options(self, parser, env={}):
186 - ... print "env:", env
187 + ... print("env:", env)
189 To test the argv, we use a config class that prints the argv it's
190 given by nose. We need to monkeypatch nose.config.Config, so that we
191 @@ -39,7 +39,7 @@
192 >>> class PrintArgvConfig(old_config):
194 ... def configure(self, argv=None, doc=None):
195 - ... print "argv:", argv
196 + ... print("argv:", argv)
197 ... old_config.configure(self, argv, doc)
198 >>> nose.config.Config = PrintArgvConfig
200 --- nose-1.3.7/unit_tests/test_ls_tree.rst.orig
201 +++ nose-1.3.7/unit_tests/test_ls_tree.rst
202 @@ -7,7 +7,7 @@
203 >>> dir_path = tempfile.mkdtemp()
205 >>> def create_file(filename):
206 - ... fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0666)
207 + ... fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0o666)
208 ... os.close(fd)
210 >>> os.mkdir(os.path.join(dir_path, "top"))
211 @@ -32,7 +32,7 @@
212 Note that files matching skip_pattern (by default SVN files,
213 backup files and compiled Python files) are ignored
215 - >>> print ls_tree(os.path.join(dir_path, "top"))
216 + >>> print(ls_tree(os.path.join(dir_path, "top")))
217 |-- file
218 |-- file2
219 |-- .notsvn
220 --- nose-1.3.7/functional_tests/test_loader.py.orig
221 +++ nose-1.3.7/functional_tests/test_loader.py
222 @@ -369,7 +369,7 @@
223 assert res.errors, "Expected errors but got none"
224 assert not res.failures, res.failures
225 err = res.errors[0][0].test.exc_class
226 - assert err is ImportError, \
227 + assert err is ModuleNotFoundError, \
228 "Expected import error, got %s" % err
230 def test_load_nonsense_name(self):