Skip to content

test: Validate typing in tests#62

Merged
natemort merged 1 commit intocadence-workflow:mainfrom
natemort:test_mypy
Jan 21, 2026
Merged

test: Validate typing in tests#62
natemort merged 1 commit intocadence-workflow:mainfrom
natemort:test_mypy

Conversation

@natemort
Copy link
Member

While somewhat painful, type checking our tests should help ensure that what we build is idiomatic. This validates that the typing information we provide on our public functions is correct and usable.

Change mypy to be run directly rather than as a tool. Running it as a tool executes it independently of the version that we configure and made it not correctly resolve pytest. The uv documentation lists mypy as an example to use "uv run" rather than "uv tool run".

As part of enabling this, disable type checking for specific lines that need additional work in the library to correct the type checking. This is particularly around Workflow and Activity Definitions.

What changed?

  • Validate tests using mypy
  • Run mypy via uv run rather than as a tool
  • Disable warn_unused_ignores. For some reason the prometheus packages keep flaking on this, I don't know what's wrong with my local setup.
  • Miscellaneous typing fixes

Why?

  • Ensure our typing works well for test scenarios

How did you test it?

  • Running the tests

Potential risks

Release notes

Documentation Changes

@natemort natemort changed the title Validate typing in tests test: Validate typing in tests Jan 21, 2026
While somewhat painful, type checking our tests should help ensure that what we build is idiomatic. This validates that the typing information we provide on our public functions is correct and usable.

Change mypy to be run directly rather than as a tool. Running it as a tool executes it independently of the version that we configure and made it not correctly resolve pytest. The uv documentation lists mypy as an example to use "uv run" rather than "uv tool run".

As part of enabling this, disable type checking for specific lines that need additional work in the library to correct the type checking. This is particularly around Workflow and Activity Definitions.
Copy link
Member

@timl3136 timl3136 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@natemort natemort merged commit 1c30e83 into cadence-workflow:main Jan 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants