-
Notifications
You must be signed in to change notification settings - Fork 273
Open
Description
Originally reported by: jlec (Bitbucket: jlec, GitHub: jlec)
#!python
=============================================== FAILURES ================================================
_________________________________________ test_assertCountEqual _________________________________________
@py.test.mark.skipif("sys.version_info[:2] < (2, 7) or sys.version_info[:2] in ((3, 0), (3, 1))")
def test_assertCountEqual():
class TestAssertCountEqual(unittest.TestCase):
def test(self):
with self.assertRaises(AssertionError):
six.assertCountEqual(self, (1, 2), [3, 4, 5])
six.assertCountEqual(self, (1, 2), [2, 1])
> TestAssertCountEqual('test').test()
test_six.py:825:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_six.py:821: in test
six.assertCountEqual(self, (1, 2), [3, 4, 5])
six.py:667: in assertCountEqual
return getattr(self, _assertCountEqual)(*args, **kwargs)
/usr/lib64/python3.3/unittest/case.py:999: in assertCountEqual
self.fail(msg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test_six.TestAssertCountEqual testMethod=test>
msg = 'Element counts were not equal:\nFirst has 1, Second has 0: 1\nFirst has 1, Second has 0: 2\nFirst has 0, Second has 1: 3\nFirst has 0, Second has 1: 4\nFirst has 0, Second has 1: 5'
def fail(self, msg=None):
"""Fail immediately, with the given message."""
> raise self.failureException(msg)
E AssertionError: Element counts were not equal:
E First has 1, Second has 0: 1
E First has 1, Second has 0: 2
E First has 0, Second has 1: 3
E First has 0, Second has 1: 4
E First has 0, Second has 1: 5
/usr/lib64/python3.3/unittest/case.py:508: AssertionError
___________________________________________ test_assertRegex ____________________________________________
@py.test.mark.skipif("sys.version_info[:2] < (2, 7)")
def test_assertRegex():
class TestAssertRegex(unittest.TestCase):
def test(self):
with self.assertRaises(AssertionError):
six.assertRegex(self, 'test', r'^a')
six.assertRegex(self, 'test', r'^t')
> TestAssertRegex('test').test()
test_six.py:837:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_six.py:833: in test
six.assertRegex(self, 'test', r'^a')
six.py:675: in assertRegex
return getattr(self, _assertRegex)(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test_six.TestAssertRegex testMethod=test>, text = 'test'
expected_regex = <_sre.SRE_Pattern object at 0x7f9752fa7618>
msg = "Regex didn't match: '^a' not found in 'test'"
def assertRegex(self, text, expected_regex, msg=None):
"""Fail the test unless the text matches the regular expression."""
if isinstance(expected_regex, (str, bytes)):
assert expected_regex, "expected_regex must not be empty."
expected_regex = re.compile(expected_regex)
if not expected_regex.search(text):
msg = msg or "Regex didn't match"
msg = '%s: %r not found in %r' % (msg, expected_regex.pattern, text)
> raise self.failureException(msg)
E AssertionError: Regex didn't match: '^a' not found in 'test'
/usr/lib64/python3.3/unittest/case.py:1119: AssertionError
________________________________________ test_assertRaisesRegex _________________________________________
@py.test.mark.skipif("sys.version_info[:2] < (2, 7)")
def test_assertRaisesRegex():
class TestAssertRaisesRegex(unittest.TestCase):
def test(self):
with six.assertRaisesRegex(self, AssertionError, '^Foo'):
raise AssertionError('Foo')
with self.assertRaises(AssertionError):
with six.assertRaisesRegex(self, AssertionError, r'^Foo'):
raise AssertionError('Bar')
> TestAssertRaisesRegex('test').test()
test_six.py:851:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_six.py:849: in test
raise AssertionError('Bar')
/usr/lib64/python3.3/unittest/case.py:167: in __exit__
expected_regex.pattern, str(exc_value)))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <unittest.case._AssertRaisesContext object at 0x7f9750d3fc10>
standardMsg = '"^Foo" does not match "Bar"'
def _raiseFailure(self, standardMsg):
msg = self.test_case._formatMessage(self.msg, standardMsg)
> raise self.test_case.failureException(msg)
E AssertionError: "^Foo" does not match "Bar"
/usr/lib64/python3.3/unittest/case.py:123: AssertionError
============================ 3 failed, 182 passed, 1 skipped in 0.75 seconds ============================
- Bitbucket: https://bitbucket.org/gutworth/six/issue/139