Skip to content

Conversation

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Nov 5, 2022

>>> from unittest.case import TestCase >>> c = TestCase() >>> with c.assertRaisesRegex(Exception, b"x"): 1/0 ... ZeroDivisionError: division by zero During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/case.py", line 274, in __exit__ if not expected_regex.search(str(exc_value)): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: cannot use a bytes pattern on a string-like object
JelleZijlstra and others added 2 commits November 5, 2022 07:53
>>> from unittest.case import TestCase >>> c = TestCase() >>> with c.assertRaisesRegex(Exception, b"x"): 1/0 ... ZeroDivisionError: division by zero During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/case.py", line 274, in __exit__ if not expected_regex.search(str(exc_value)): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: cannot use a bytes pattern on a string-like object
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja merged commit 1f76489 into python:main Nov 5, 2022
@AlexWaygood
Copy link
Member

sad, i always wanted to

@JelleZijlstra JelleZijlstra deleted the unittest branch November 5, 2022 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants