Projects
openEuler:24.03:SP1:Everything
python-unittest2
_service:tar_scm:unittest2-1.1.0-backport-tests...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:unittest2-1.1.0-backport-tests-from-py3.5.patch of Package python-unittest2
--- a/unittest2/test/test_loader.py.orig 2015-11-15 09:26:43.752421511 +0100 +++ b/unittest2/test/test_loader.py 2015-11-15 11:02:43.944233784 +0100 @@ -512,10 +512,20 @@ def test_loadTestsFromName__relative_malformed_name(self): loader = unittest.TestLoader() + # XXX Should this raise AttributeError or ValueError? suite = loader.loadTestsFromName('abc () //', unittest) error, test = self.check_deferred_error(loader, suite) - self.check_module_lookup_error( - error, test, 'unittest2', 'abc () //', 'abc \(\) //') + if sys.version_info[:2] < (3, 5): + expected = "'module' object has no attribute 'abc () //'" + expected_regex = "'module' object has no attribute 'abc \(\) //'" + else: + expected = "module 'unittest2' has no attribute 'abc () //'" + expected_regex = "module 'unittest2' has no attribute 'abc \(\) //'" + self.assertIn( + expected, error, + 'missing error string in %r' % error) + self.assertRaisesRegex( + AttributeError, expected_regex, getattr(test, 'abc () //')) # "The method optionally resolves name relative to the given module" # @@ -924,8 +934,17 @@ # XXX Should this raise AttributeError or ValueError? suite = loader.loadTestsFromNames(['abc () //'], unittest) error, test = self.check_deferred_error(loader, list(suite)[0]) - self.check_module_lookup_error( - error, test, 'unittest2', 'abc () //', 'abc \(\) //') + if sys.version_info[:2] < (3, 5): + expected = "'module' object has no attribute 'abc () //'" + expected_regex = "'module' object has no attribute 'abc \(\) //'" + else: + expected = "module 'unittest2' has no attribute 'abc () //'" + expected_regex = "module 'unittest2' has no attribute 'abc \(\) //'" + self.assertIn( + expected, error, + 'missing error string in %r' % error) + self.assertRaisesRegex( + AttributeError, expected_regex, getattr(test, 'abc () //')) # "The method optionally resolves name relative to the given module" #
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2