Open dimaqq opened 2 months ago
Given this code:
class SomeCharm(ops.CharmBase): ... def _on_relation(self, event): assert event.something == some_sanity_check
I'd expect to run pytest --pdb and get dropped into this failing assertion line.
pytest --pdb
Instead, I'm getting:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > /code/hexanator/.tox/unit/lib/python3.12/site-packages/scenario/runtime.py(469)exec() -> raise UncaughtCharmError( (Pdb)
And I can't get to the original line that triggered the exception.
Here's a cleaned up back trace for reference:
_pytest/python.py(162)pytest_pyfunc_call() -> result = testfunction(**testargs) tests/unit/test_scenario.py(56)test_rate_limit() -> ctx.run(ctx.on.relation_created(relation), initial_state) scenario/context.py(613)run() -> with self._run_event(event=event, state=state) as ops: contextlib.py(158)__exit__() -> self.gen.throw(value) scenario/context.py(598)_run_event() -> with self._run(event=event, state=state) as ops: contextlib.py(158)__exit__() -> self.gen.throw(value) scenario/context.py(660)_run() -> with runtime.exec( contextlib.py(158)__exit__() -> self.gen.throw(value) scenario/runtime.py(469)exec() -> raise UncaughtCharmError(
See also #76.
Given this code:
I'd expect to run
pytest --pdb
and get dropped into this failing assertion line.Instead, I'm getting:
And I can't get to the original line that triggered the exception.
Here's a cleaned up back trace for reference: