Skip to content

[behave]: add some common decorators#15505

Merged
srittau merged 9 commits intopython:mainfrom
hoel-bagard:behave
Mar 16, 2026
Merged

[behave]: add some common decorators#15505
srittau merged 9 commits intopython:mainfrom
hoel-bagard:behave

Conversation

@hoel-bagard
Copy link
Contributor

@hoel-bagard hoel-bagard commented Mar 12, 2026

This PR adds some of the most common decorators from the behave package.

I've tried to keep it small, which is why the Context class uses a lot of Any. This could be completed in subsequent PRs.

@hoel-bagard hoel-bagard changed the title behave: add given, when, then, step, use_fixture, fixture and Context [behave]: add some common decorators Mar 12, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@hoel-bagard hoel-bagard marked this pull request as ready for review March 13, 2026 13:42
@srittau
Copy link
Collaborator

srittau commented Mar 16, 2026

I've tried to keep it small, which is why the Context class uses a lot of Any. This could be completed in subsequent PRs.

Quick initial note: Please use Incomplete (from _typeshed) for this purpose. It's an easily greppable alias for Any,

@hoel-bagard
Copy link
Contributor Author

@srittau Thank you for the review.

If I replace all the Any by Incomplete, then the flake8 pre-commit fails with:

Y065 Leave parameter "value" unannotated rather than using "Incomplete"
Y065 Leave return type unannotated rather than using "Incomplete"

I can fix those errors by removing some of the Incomplete, but then the pyright CI fails. What's the correct way to address this ?

@github-actions

This comment has been minimized.

@brianschubert
Copy link
Collaborator

You'll need to add behave to the exclude list in pyrightconfig.stricter.json here:

@github-actions

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks! A few comments below.

hoel-bagard and others added 2 commits March 16, 2026 23:02
Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>

fix: use ClassVar

Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>

Apply suggestions from code review

Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>

Apply suggestions from code review

Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>

fix: add missing imports
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hoel-bagard hoel-bagard requested a review from srittau March 16, 2026 14:22
@srittau srittau merged commit ed11953 into python:main Mar 16, 2026
39 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.

3 participants