[issue35965] Behavior for unittest.assertRaisesRegex differs depending on whether it is used as a context manager

Karthikeyan Singaravelan report at bugs.python.org
Mon Feb 11 12:51:18 EST 2019


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

No problem, after some debugging the statement finally executed is 'exec(compile("set.add(0)", "foo.py", "exec"))' . In Python interpreter this will give the expected error. It also gives the same error before coverage.start() [0] and gives a different one as in the report once the statement is executed after coverage.start(). So this might be something to do with coverage and I have less knowledge about the internals.

I am closing this as third party since I couldn't see any issue with CPython and you might want to follow up coverage issue tracker. Thanks for the report though!

[0] https://github.com/nedbat/coveragepy/blob/f12db7fd4b3ab288f7f770f7138062951feaa6c9/coverage/cmdline.py#L639

----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35965>
_______________________________________


More information about the Python-bugs-list mailing list