Skip to content

Commit 198c9c2

Browse files
committed
Add debug fprintf to test_interpreter.cpp
1 parent 29f4940 commit 198c9c2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_embed/test_interpreter.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,18 @@ bool has_pybind11_internals_static() {
173173

174174
TEST_CASE("Restart the interpreter") {
175175
// Verify pre-restart state.
176+
fprintf(stdout,
177+
"\nLOOOK PYTHONPATH %s\n",
178+
py::module_::import("os")
179+
.attr("environ")
180+
.attr("get")("PYTHONPATH")
181+
.attr("__str__")()
182+
.cast<std::string>()
183+
.c_str());
184+
fflush(stdout);
185+
auto sys_path = py::module_::import("sys").attr("path").attr("__str__")().cast<std::string>();
186+
fprintf(stdout, "\nLOOOK sys.path %s\n", sys_path.c_str());
187+
fflush(stdout);
176188
REQUIRE(py::module_::import("widget_module").attr("add")(1, 2).cast<int>() == 3);
177189
REQUIRE(has_pybind11_internals_builtin());
178190
REQUIRE(has_pybind11_internals_static());

0 commit comments

Comments
 (0)