FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add typehints for step func returning types by starod00m · Pull Request #830 · allure-framework/allure-python · GitHub

Add typehints for step func returning types - #830

Merged
delatrie merged 1 commit into
allure-framework:masterfrom
starod00m:fix-missing-typehints-for-step
Mar 27, 2025
Merged

Add typehints for step func returning types#830
delatrie merged 1 commit into
allure-framework:masterfrom
starod00m:fix-missing-typehints-for-step

Conversation

Copy link
Copy Markdown
Contributor

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 commented Sep 20, 2024
edited
Loading

Copy link
Copy Markdown


All committers have signed the CLA.

starod00m marked this pull request as draft September 20, 2024 05:10
starod00m force-pushed the fix-missing-typehints-for-step branch 2 times, most recently from c4a3841 to c13f359 Compare September 20, 2024 05:20
starod00m marked this pull request as ready for review September 20, 2024 05:26
delatrie force-pushed the fix-missing-typehints-for-step branch from c13f359 to 93c015a Compare March 27, 2025 08:16
delatrie linked an issue Mar 27, 2025 that may be closed by this pull request
1 task

delatrie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hi, @starod00m ! Thank you for your contribution!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pyright check is failing for functions call decorated with allure step Need to add overload functions for allure.step()

3 participants


Back | FazBrowse Home | New Git URL