Blame SOURCES/unittest2-1.1.0-backport-tests-from-py3.5.patch

c3e266
--- unittest2/test/test_loader.py.orig	2015-11-15 09:26:43.752421511 +0100
c3e266
+++ unittest2/test/test_loader.py	2015-11-15 11:02:43.944233784 +0100
c3e266
@@ -512,10 +512,20 @@
c3e266
     def test_loadTestsFromName__relative_malformed_name(self):
c3e266
         loader = unittest.TestLoader()
c3e266
 
c3e266
+        # XXX Should this raise AttributeError or ValueError?
c3e266
         suite = loader.loadTestsFromName('abc () //', unittest)
c3e266
         error, test = self.check_deferred_error(loader, suite)
c3e266
-        self.check_module_lookup_error(
c3e266
-            error, test, 'unittest2', 'abc () //', 'abc \(\) //')
c3e266
+        if sys.version_info[:2] < (3, 5):
c3e266
+            expected = "'module' object has no attribute 'abc () //'"
c3e266
+            expected_regex = "'module' object has no attribute 'abc \(\) //'"
c3e266
+        else:
c3e266
+            expected = "module 'unittest2' has no attribute 'abc () //'"
c3e266
+            expected_regex = "module 'unittest2' has no attribute 'abc \(\) //'"
c3e266
+        self.assertIn(
c3e266
+            expected, error,
c3e266
+            'missing error string in %r' % error)
c3e266
+        self.assertRaisesRegex(
c3e266
+            AttributeError, expected_regex, getattr(test, 'abc () //'))
c3e266
 
c3e266
     # "The method optionally resolves name relative to the given module"
c3e266
     #
c3e266
@@ -924,8 +934,17 @@
c3e266
         # XXX Should this raise AttributeError or ValueError?
c3e266
         suite = loader.loadTestsFromNames(['abc () //'], unittest)
c3e266
         error, test = self.check_deferred_error(loader, list(suite)[0])
c3e266
-        self.check_module_lookup_error(
c3e266
-            error, test, 'unittest2', 'abc () //', 'abc \(\) //')
c3e266
+        if sys.version_info[:2] < (3, 5):
c3e266
+            expected = "'module' object has no attribute 'abc () //'"
c3e266
+            expected_regex = "'module' object has no attribute 'abc \(\) //'"
c3e266
+        else:
c3e266
+            expected = "module 'unittest2' has no attribute 'abc () //'"
c3e266
+            expected_regex = "module 'unittest2' has no attribute 'abc \(\) //'"
c3e266
+        self.assertIn(
c3e266
+            expected, error,
c3e266
+            'missing error string in %r' % error)
c3e266
+        self.assertRaisesRegex(
c3e266
+            AttributeError, expected_regex, getattr(test, 'abc () //'))
c3e266
 
c3e266
     # "The method optionally resolves name relative to the given module"
c3e266
     #