Skip to main content
Grid tests run the same test logic across multiple implementations or configurations using pytest’s parametrize feature.

Case Type Pattern

Define a Case dataclass that holds everything needed to run tests against a specific implementation:

Capability Tags

Use tags to indicate what features each implementation supports:
skip

Filtered Test Lists

Build separate lists for each capability to use with parametrize:
skip

Test Functions

Use the filtered lists in parametrize decorators:
skip

Context Managers

Each implementation provides a context manager factory:

Test Data Guidelines

  • Always provide exactly 3 topic/value pairs for consistency
  • For typed implementations, use different types per topic to verify type handling
  • For bytes implementations, use simple distinguishable byte strings
skip

Examples

  • dimos/protocol/pubsub/test_spec.py - Basic pubsub operations
  • dimos/protocol/pubsub/test_subscribe_all.py - Pattern subscriptions
  • dimos/protocol/pubsub/benchmark/testdata.py - Benchmark cases