Pytests in forked mode not calling global object destructors on process exit #13378
-
I have some pytests to test my Python functions. Within each testcase, C++ functions are called using pybind11 APIs. On calling these tests in forked mode |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
pytest-forked is currently unmaintained in part because it has no solutions for the mentioned issues one part is that process global teardown happens after pytest in the forced process exits the other part is that any non-function-setupstate gets copied to the fork in a uncontrolled fashion its currently not safe to use pytest-forked for anything that sets up process global state and relies on cleanup, |
Beta Was this translation helpful? Give feedback.
Its not recommended to use forked
It basically calls fork mid testrun copying the setupstate to the new procedure
Then it runs a single test there amd exits