Skip to content
Snippets Groups Projects
Commit dfa753e4 authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1839263 - Don't derive assertRaisesFromLine from assertRaises....

Bug 1839263 - Don't derive assertRaisesFromLine from assertRaises. r=firefox-build-system-reviewers,ahochheiden, a=test-only DONTBUILD

In python 3.11 (maybe also 3.10, I haven't tested that version ; 3.9 was
definitely different), by the time the context manager comes back in our
assertRaisesFromLine, the traceback is not available anymore (or yet,
I'm not entirely sure which way it does) to inspect and check the line
numbers we want to check.

And while assertRaises exposes the thrown exception in its `exception`
attribute, it also resets the traceback associated with it, so we can't
find it there either.

So instead, we implement our own context manager for
assertRaisesFromLine such that we can access that traceback.

Differential Revision: https://phabricator.services.mozilla.com/D181425
parent 0f09a132
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment