Skip to content

Commit

Permalink
Fix status_testing_no_cpp_eh_test
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 670943518
  • Loading branch information
pybind11_abseil authors authored and copybara-github committed Sep 4, 2024
1 parent baadf89 commit 68b76aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pybind11_abseil/compat/status_from_py_exc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ PyObject* PyStatusNotOkOrNone() {
static PyObject* kImportedObj = nullptr;
if (kImportedObj == nullptr) {
kImportedObj = py_base_utilities::ImportObjectOrReturnNone(
"google3.third_party.pybind11_abseil.status", "StatusNotOk");
"pybind11_abseil.status", "StatusNotOk");
}
return kImportedObj;
}
Expand Down
12 changes: 6 additions & 6 deletions pybind11_abseil/tests/status_testing_no_cpp_eh_test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def cb():
expected = 'OK'
else:
expected = (
'INVALID_ARGUMENT: Unable to cast Python instance of type <class'
" 'list'> to C++ type 'absl::Status'"
r"INVALID_ARGUMENT: Unable to cast Python instance of type <class"
r" 'list'> to C\+\+ type 'absl::(\w*::)?Status'"
)
self.assertEqual(self.tm.CallCallbackWithStatusReturn(cb), expected)
self.assertRegex(self.tm.CallCallbackWithStatusReturn(cb), expected)

def testAssertionErrorBare(self): # pylint: disable=invalid-name

Expand Down Expand Up @@ -117,10 +117,10 @@ def cb():
expected = 'INVALID_ARGUMENT: TypeError: expecting int'
else:
expected = (
'INVALID_ARGUMENT: Unable to cast Python instance of type <class'
" 'str'> to C++ type 'absl::StatusOr<int>'"
r"INVALID_ARGUMENT: Unable to cast Python instance of type <class"
r" 'str'> to C\+\+ type 'absl::(\w*::)?StatusOr<int>'"
)
self.assertEqual(self.tm.CallCallbackWithStatusOrIntReturn(cb), expected)
self.assertRegex(self.tm.CallCallbackWithStatusOrIntReturn(cb), expected)


class StatusOrPyObjectPtrTest(absltest.TestCase):
Expand Down

0 comments on commit 68b76aa

Please sign in to comment.