diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-03-15 15:44:17 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-03-15 15:53:18 -0700 |
commit | 9dbce774eea515e400954f1d0ffbd858c839b546 (patch) | |
tree | cc0493b6d1bbd5a777f0283e00bd0a8907d21769 /lldb/unittests | |
parent | e35c71493b3a191b7a836d62feb0039b79b0b428 (diff) | |
download | llvm-9dbce774eea515e400954f1d0ffbd858c839b546.tar.gz |
[lldb] Update PythonDataObjectsTests for new exception formatting
PythonDataObjectsTest.TestExceptions started failing because the output
of the python traceback printers is now consistent between python and
cpython [1]. Work around the issue by supporting both variants.
Thanks to Ismail for identifying the root cause.
[1] https://github.com/python/cpython/issues/85203
Diffstat (limited to 'lldb/unittests')
-rw-r--r-- | lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp index 2bf713e08576..733b919e2860 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp @@ -802,10 +802,13 @@ def main(): PythonScript lol(script2); - EXPECT_THAT_EXPECTED(lol(), - llvm::Failed<PythonException>(testing::Property( - &PythonException::ReadBacktrace, - testing::ContainsRegex("unprintable MyError")))); + EXPECT_THAT_EXPECTED( + lol(), + llvm::Failed<PythonException>(testing::Property( + &PythonException::ReadBacktrace, + testing::AnyOf( + testing::ContainsRegex("MyError: <exception str\\(\\) failed>"), + testing::ContainsRegex("unprintable MyError"))))); #endif } |