tractor/tests/msg
Tyler Goodlet 20514611d1 Dynamically set `pld_spec` for `test_basic_payload_spec()
Such that we can parametrize the `@context(pld_spec)` endpoint setting
using `pytest` and of course enable testing more then just the lone
`maybe_msg_spec` case. The implementation was a bit tricky because
subactors import any `enable_modules` just after subproc spawn, so
there's no easy way to indicate from the parent should should be passed
to the `@context()` decorator since it's already resolved by the time an
IPC is established. Thus the bulk of this patch is implementing
a pre-ctx which monkey-patches the (test) `child()`-ep-defining-module
before running test logic.

Impl deats,
- drop `maybe_msg_spec` global instead providing the same value via
  a new `pld_spec: Union[Type]` parametrized input to the test suite.
- add a `decorate_child_ep()` helper which (re-)decorates the
  mod-defined `child()` IPC-context endpoint with the provided `pld_spec`.
- add a new "pre IPC context" endpoint: `set_chld_pldspec()` which can
  be opened (from another actor) just prior to opening the `child()` ep
  and it will decorate the latter (using `decorate_child_ep()`)
  presuming a `.msg._exts.enc_type_union()` generated  `pld_spec_strs`
  is provided.
- actually open the `set_chld_pldspec()` as a `deco_ctx` rom the
  root-actor and ensure we cancel it on block teardown in non-raising
  cases.
2026-03-18 00:08:47 -04:00
..
__init__.py Add `tests/msg/` sub-pkg, audit `pformat()` filtering 2026-03-12 18:32:31 -04:00
conftest.py Add `tests/msg/` sub-pkg, audit `pformat()` filtering 2026-03-12 18:32:31 -04:00
test_ext_types_msgspec.py Add `tests/msg/` sub-pkg, audit `pformat()` filtering 2026-03-12 18:32:31 -04:00
test_pldrx_limiting.py Dynamically set `pld_spec` for `test_basic_payload_spec() 2026-03-18 00:08:47 -04:00
test_pretty_struct.py Drop unused import noticed by `copilot` 2026-03-13 11:52:18 -04:00