MCPcopy
hub / github.com/pytest-dev/pytest-xdist / Producer

Class Producer

src/xdist/remote.py:39–59  ·  view source on GitHub ↗

Simplified implementation of the same interface as py.log, for backward compatibility since we dropped the dependency on pylib. Note: this is defined here because this module can't depend on xdist, so we need to have the other way around.

Source from the content-addressed store, hash-verified

37
38
39class Producer:
40 """
41 Simplified implementation of the same interface as py.log, for backward compatibility
42 since we dropped the dependency on pylib.
43 Note: this is defined here because this module can't depend on xdist, so we need
44 to have the other way around.
45 """
46
47 def __init__(self, name: str, *, enabled: bool = True) -> None:
48 self.name = name
49 self.enabled = enabled
50
51 def __repr__(self) -> str:
52 return f"{type(self).__name__}({self.name!r}, enabled={self.enabled})"
53
54 def __call__(self, *a: Any, **k: Any) -> None:
55 if self.enabled:
56 print(f"[{self.name}]", *a, **k, file=sys.stderr)
57
58 def __getattr__(self, name: str) -> Producer:
59 return type(self)(name, enabled=self.enabled)
60
61
62def worker_title(title: str) -> None:

Callers 9

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…