| name = 'rtrader.services.bug_lifecycle.feature_flags'
|
|
|
| def resolve(name: str) -> object:
|
| # Simplified from zope.dottedname.
|
| parts = name.split(".")
|
|
|
| used = parts.pop(0)
|
| found: object = __import__(used)
|
| for part in parts:
|
| used += "." + part
|
| try:
|
| found = getattr(found, part)
|
| except AttributeError:
|
| pass
|
| else:
|
| continue
|
| # We use explicit un-nesting of the handling block in order
|
| # to avoid nested exceptions.
|
| try:
|
| > __import__(used)
|
| E ModuleNotFoundError: No module named 'rtrader.services.bug_lifecycle.feature_flags'; 'rtrader.services.bug_lifecycle' is not a package
|
|
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/_pytest/monkeypatch.py:79: ModuleNotFoundError
|
|
|
| The above exception was the direct cause of the following exception:
|
|
|
| self = <test_pm_dashboard_event_bus.TestEmitPmAgentEvent object at 0x13ff55af0>
|
| dbf = <function dbf.<locals>.<lambda> at 0x149e92200>
|
| fake_redis = <test_pm_dashboard_event_bus.FakeRedis object at 0x1498e09b0>
|
| monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x13ffa9250>
|
|
|
| def test_spawned_writes_pm_agent_payload_with_required_fields(self, dbf, fake_redis, monkeypatch):
|
| """A spawn write must produce a BugEvents row with kind=='pm_agent', sub_kind=='spawned', and
|
| the fields the SSE listener needs to splice the row in (fingerprint + tier + host + ts)."""
|
| > _stub_flag(monkeypatch, enabled=True)
|
|
|
| tests/services/test_pm_dashboard_event_bus.py:177:
|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
| tests/services/test_pm_dashboard_event_bus.py:157: in _stub_flag
|
| monkeypatch.setattr(
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/_pytest/monkeypatch.py:104: in derive_importpath
|
| target = resolve(module)
|
| ^^^^^^^^^^^^^^^
|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
| name = 'rtrader.services.bug_lifecycle.feature_flags'
|
|
|
| def resolve(name: str) -> object:
|
| # Simplified from zope.dottedname.
|
| parts = name.split(".")
|
|
|
| used = parts.pop(0)
|
| found: object = __import__(used)
|
| for part in parts:
|
| used += "." + part
|
| try:
|
| found = getattr(found, part)
|
| except AttributeError:
|
| pass
|
| else:
|
| continue
|
| # We use explicit un-nesting of the handling block in order
|
| # to avoid nested exceptions.
|
| try:
|
| __import__(used)
|
| except ImportError as ex:
|
| expected = str(ex).split()[-1]
|
| if expected == used:
|
| raise
|
| else:
|
| > raise ImportError(f"import error in {used}: {ex}") from ex
|
| E ImportError: import error in rtrader.services.bug_lifecycle.feature_flags: No module named 'rtrader.services.bug_lifecycle.feature_flags'; 'rtrader.services.bug_lifecycle' is not a package
|
|
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/_pytest/monkeypatch.py:85: ImportError
|