Skip to content

Preserve type when using fixture#455

Merged
jelmer merged 2 commits intotesting-cabal:masterfrom
allenap:preserve-type-when-using-fixture
Jul 22, 2025
Merged

Preserve type when using fixture#455
jelmer merged 2 commits intotesting-cabal:masterfrom
allenap:preserve-type-when-using-fixture

Conversation

@allenap
Copy link
Copy Markdown
Contributor

@allenap allenap commented Jul 22, 2025

This adds a TypeVar to useFixture such that, in the code below, type checkers (e.g. pyright) see the type of my_fixture as MyFixture:

my_fixture = self.useFixture(MyFixture())

@jelmer jelmer self-assigned this Jul 22, 2025
@jelmer jelmer merged commit 6b46551 into testing-cabal:master Jul 22, 2025
7 checks passed
@allenap allenap deleted the preserve-type-when-using-fixture branch July 22, 2025 11:09
@allenap
Copy link
Copy Markdown
Contributor Author

allenap commented Jul 22, 2025

Thanks @jelmer!

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