Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typehints for step func returning types #830

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

starod00m
Copy link

Context

There are several issues with using pyright as lsp:

  1. When using allure.step as a context manager with with allure.step, pyright returned the errors: Object of type "(...) -> object" cannot be used with "with" because it does not implement __exit__, Object of type "(...) -> object" cannot be used with "with" because it does not implement __enter__ (lsp).
  2. When using allure.step as a decorator along with @property, pyright returned the error: Argument of type "((self: Self@ClassName) -> SomeReturnType) | object" cannot be assigned to parameter "fget" of type "((Any) -> Any) | None" in function "__init__".
  3. The most critical part: because pyright could not correctly determine the types, there was no autocompletion available when writing tests using pyright as the LSP.

Checklist

@CLAassistant
Copy link

CLAassistant commented Sep 20, 2024

CLA assistant check
All committers have signed the CLA.

@starod00m starod00m marked this pull request as draft September 20, 2024 05:10
@starod00m starod00m marked this pull request as ready for review September 20, 2024 05:26
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