We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fe3c48 commit fb100dbCopy full SHA for fb100db
pytest_cov.py
@@ -4,6 +4,34 @@
4
import pytest
5
6
import cov_core
7
+import cov_core_init
8
+
9
+from py._process import forkedfunc
10
11
12
+class PatchedForkedFunc(forkedfunc.ForkedFunc):
13
14
+ def _child(self, nice_level):
15
+ import os
16
+ _exit = os._exit
17
+ exit_args = list()
18
19
+ def _capture_args(*args):
20
+ exit_args.extend(list(args))
21
22
+ os._exit = _capture_args
23
24
+ cov = cov_core_init.init()
25
+ try:
26
+ super(PatchedForkedFunc, self)._child(nice_level)
27
+ finally:
28
+ cov_core.multiprocessing_finish(cov)
29
+ _exit(*exit_args)
30
31
+forkedfunc.ForkedFunc = PatchedForkedFunc
32
33
+from py import process
34
+process.ForkedFunc = PatchedForkedFunc
35
36
37
def pytest_addoption(parser):
0 commit comments