Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
[lldb] Update PythonDataObjectsTests for new exception formatting
Browse files Browse the repository at this point in the history
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] python/cpython#85203
  • Loading branch information
JDevlieghere authored and agozillon committed Mar 17, 2023
1 parent a69578d commit d3e4265
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d3e4265

Please sign in to comment.