aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-unittest2-python3-compat.patch
blob: fe0afe559a0421b39043767ac3abc1c278b1c265 (about) (plain)
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
Skip tests that fail with newer versions of Python.

Patch copied from Gentoo:

https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/unittest2/files/unittest2-1.1.0-python3.5-test.patch

diff --git a/unittest2/test/test_loader.py b/unittest2/test/test_loader.py
index 683f662..347eea5 100644
--- a/unittest2/test/test_loader.py
+++ b/unittest2/test/test_loader.py
@@ -509,6 +509,7 @@ class Test_TestLoader(unittest2.TestCase):
     #
     # What happens when an impossible name is given, relative to the provided
     # `module`?
+    @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here")
     def test_loadTestsFromName__relative_malformed_name(self):
         loader = unittest.TestLoader()
 
@@ -811,6 +812,7 @@ class Test_TestLoader(unittest2.TestCase):
     # TestCase or TestSuite instance."
     #
     # What happens when presented with an impossible module name?
+    @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here")
     def test_loadTestsFromNames__malformed_name(self):
         loader = unittest2.TestLoader()
 
@@ -918,6 +920,7 @@ class Test_TestLoader(unittest2.TestCase):
     # "The method optionally resolves name relative to the given module"
     #
     # What happens when presented with an impossible attribute name?
+    @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here")
     def test_loadTestsFromNames__relative_malformed_name(self):
         loader = unittest.TestLoader()
 
nse # along with this program. If not, see <https://www.gnu.org/licenses/>. # # # I, Wojtek Kosior, thereby promise not to sue for violation of this # file's license. Although I request that you do not make use this code # in a proprietary program, I am not going to enforce this in court. import sys import time import code from rlcompleter import Completer import readline from .server import do_an_internet from .misc_constants import * from .profiles import firefox_safe_mode def fail(msg, error_code): print('Error:', msg) print('Usage:', sys.argv[0], '[certificates_directory] [proxy_port]') sys.exit(error_code) certdir = Path(sys.argv[1]).resolve() if len(sys.argv) > 1 else default_cert_dir if not certdir.is_dir(): fail('selected certificate directory does not exist.', 2) port = sys.argv[2] if len(sys.argv) > 2 else str(default_proxy_port) if not port.isnumeric(): fail('port must be an integer.', 3) httpd = do_an_internet(certdir, int(port)) driver = firefox_safe_mode(proxy_port=int(port)) print("You can now control the browser through 'driver' object") # Here we enable readline-enhanced editing: # https://stackoverflow.com/questions/35115208/is-there-any-way-to-combine-readline-rlcompleter-and-interactiveconsole-in-pytho#answer-35116399 readline.parse_and_bind('tab: complete'); console_locals = globals() readline.set_completer(Completer(console_locals).complete) code.InteractiveConsole(locals=globals()).interact() driver.quit() httpd.shutdown()