mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 08:32:02 +00:00
Compare commits
3 Commits
ea4fd937bb
...
324916b95f
Author | SHA1 | Date | |
---|---|---|---|
|
324916b95f | ||
|
83b92ceb35 | ||
|
4f75726251 |
@ -64,7 +64,7 @@ type is explicitly allowed.
|
|||||||
value.long_value = PyLong_AsLong(tmp);
|
value.long_value = PyLong_AsLong(tmp);
|
||||||
Py_DECREF(tmp);
|
Py_DECREF(tmp);
|
||||||
/* Ensure return code was OK (to avoid out-of-range errors etc) */
|
/* Ensure return code was OK (to avoid out-of-range errors etc) */
|
||||||
return !(value.long_value == -1 && !PyErr_Occurred());
|
return !(value.long_value == -1 && PyErr_Occurred());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -312,8 +312,16 @@ void print_created(T *inst, Values &&...values) {
|
|||||||
}
|
}
|
||||||
template <class T, typename... Values>
|
template <class T, typename... Values>
|
||||||
void print_destroyed(T *inst, Values &&...values) { // Prints but doesn't store given values
|
void print_destroyed(T *inst, Values &&...values) { // Prints but doesn't store given values
|
||||||
|
/*
|
||||||
|
* On GraalPy, destructors can trigger anywhere and this can cause random
|
||||||
|
* failures in unrelated tests.
|
||||||
|
*/
|
||||||
|
#if !defined(GRAALVM_PYTHON)
|
||||||
print_constr_details(inst, "destroyed", values...);
|
print_constr_details(inst, "destroyed", values...);
|
||||||
track_destroyed(inst);
|
track_destroyed(inst);
|
||||||
|
#else
|
||||||
|
py::detail::silence_unused_warnings(inst, values...);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
template <class T, typename... Values>
|
template <class T, typename... Values>
|
||||||
void print_values(T *inst, Values &&...values) {
|
void print_values(T *inst, Values &&...values) {
|
||||||
|
@ -6,14 +6,8 @@ from io import StringIO
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import env # noqa: F401
|
|
||||||
from pybind11_tests import iostream as m
|
from pybind11_tests import iostream as m
|
||||||
|
|
||||||
pytestmark = pytest.mark.skipif(
|
|
||||||
"env.GRAALPY",
|
|
||||||
reason="Delayed prints from finalizers from other tests can end up in the output",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_captured(capsys):
|
def test_captured(capsys):
|
||||||
msg = "I've been redirected to Python, I hope!"
|
msg = "I've been redirected to Python, I hope!"
|
||||||
|
Loading…
Reference in New Issue
Block a user