|
oct
|
Public Member Functions | |
| None | __init__ (self, Path root) |
| None | record (self, str resource) |
| None | record_path (self, Any target) |
| None | record_launch (self, Any argv, *, Any cwd=None) |
| dict[str, set[str]] | resources (self) |
| None | install (self) |
| None | remove (self) |
Public Attributes | |
| root = Path(root).resolve() | |
| dict | records = {} |
| set[str] | env_writers = set() |
| set[str] | spawners = set() |
| str|None | current = None |
Static Public Attributes | |
| tuple | TRACE_REQUIRES_SERIAL |
Protected Member Functions | |
| bool | _git_is_temporary (self, Sequence[Any] argv, Any cwd) |
| None | _patch (self, Any owner, str name, Callable factory) |
| Callable | _open_wrapper (self, Callable original) |
| Callable | _chdir_wrapper (self, Callable original) |
| Callable | _env_wrapper (self, Callable original) |
| Callable | _bind_wrapper (self, Callable original) |
| Callable | _popen_wrapper (self, Callable original) |
Protected Attributes | |
| list | _installed = [] |
| _temp | |
| _pid = str(os.getpid()) | |
| _open_wrapper | |
| _chdir_wrapper | |
| _env_wrapper | |
| _bind_wrapper | |
| _popen_wrapper | |
Static Protected Attributes | |
| _Tracer | _TRACER = None |
| Path | _TRACE_PATH = None |
Wrap the process-global seams and attribute them to a file. Only WRITE-shaped events are recorded - a read cannot collide. Every observation is attributed to the test file that was running when it happened, so the trace shares the static pass's key space. Every wrapper is ``functools.wraps``-ed onto the seam it replaces, so a wrapped function still reports the original's ``__name__``, ``__qualname__``, ``__doc__`` and ``__wrapped__``: code under test that inspects the identity of a patched binding must see what it would see untraced (gate finding R2).
Definition at line 2623 of file parallel.py.
| None oct.testing.parallel._Tracer.__init__ | ( | self, | |
| Path | root ) |
Definition at line 2637 of file parallel.py.
|
protected |
|
protected |
|
protected |
|
protected |
Vouch for Git only when cwd and every -C remain temporary. Global configuration and explicit repository overrides can target locations outside cwd and therefore keep the launch unattributed.
Definition at line 2704 of file parallel.py.
|
protected |
|
protected |
Replace ``owner.name`` with ``factory(original)``.
Definition at line 2754 of file parallel.py.
|
protected |
| None oct.testing.parallel._Tracer.install | ( | self | ) |
Wrap every traced seam.
Definition at line 2761 of file parallel.py.
| None oct.testing.parallel._Tracer.record | ( | self, | |
| str | resource ) |
Attribute *resource* to the file under test.
Definition at line 2650 of file parallel.py.
| None oct.testing.parallel._Tracer.record_launch | ( | self, | |
| Any | argv, | ||
| * | , | ||
| Any | cwd = None ) |
Attribute a child launch to the file under test (P3). The tracer sees the REAL argv, so it keys what the static pass can only guess at; an argv whose family the committed table does not vouch for still contributes the bare wildcard.
Definition at line 2687 of file parallel.py.
| None oct.testing.parallel._Tracer.record_path | ( | self, | |
| Any | target ) |
Attribute a write to *target* to the file under test.
Definition at line 2655 of file parallel.py.
| None oct.testing.parallel._Tracer.remove | ( | self | ) |
Restore every wrapped seam, newest first.
Definition at line 2773 of file parallel.py.
| dict[str, set[str]] oct.testing.parallel._Tracer.resources | ( | self | ) |
The trace as recorded. The P2 env/subprocess join happens at the seam now: :meth:`record_launch` records the family's own tokens, or the bare one, at the moment of the launch, and the environment seam records :data:`RES_ENV_MUTATION` (Plan 276 P1) - which is process-local, so it never groups anything. :attr:`spawners` and :attr:`env_writers` stay as the diagnostic record of WHICH files launched a child and WHICH wrote the environment.
Definition at line 2740 of file parallel.py.
|
protected |
Definition at line 2769 of file parallel.py.
|
protected |
Definition at line 2766 of file parallel.py.
|
protected |
Definition at line 2767 of file parallel.py.
|
protected |
Definition at line 2643 of file parallel.py.
|
protected |
Definition at line 2764 of file parallel.py.
|
protected |
Definition at line 2647 of file parallel.py.
|
protected |
Definition at line 2770 of file parallel.py.
|
protected |
Definition at line 2644 of file parallel.py.
|
staticprotected |
Definition at line 2842 of file parallel.py.
|
staticprotected |
Definition at line 2839 of file parallel.py.
| oct.testing.parallel._Tracer.current = None |
Definition at line 2642 of file parallel.py.
| set[str] oct.testing.parallel._Tracer.env_writers = set() |
Definition at line 2640 of file parallel.py.
| dict oct.testing.parallel._Tracer.records = {} |
Definition at line 2639 of file parallel.py.
| oct.testing.parallel._Tracer.root = Path(root).resolve() |
Definition at line 2638 of file parallel.py.
| set[str] oct.testing.parallel._Tracer.spawners = set() |
Definition at line 2641 of file parallel.py.
|
static |
Definition at line 2846 of file parallel.py.