Skip to content

[ty] Add mdtest for staticmethod assigned in class body - #23330

Merged
sharkdp merged 1 commit into
astral-sh:mainfrom
Hugo-Polloli:mdtest-staticmethod-assignment
Feb 16, 2026
Merged

sharkdp merged 1 commit into
astral-sh:mainfrom
Hugo-Polloli:mdtest-staticmethod-assignment

Conversation

@Hugo-Polloli

Copy link
Copy Markdown
Contributor

Summary

Ref: astral-sh/ty#2724

Adds an mdtest regression case for:

  • bar = staticmethod(foo)
  • __call__ = staticmethod(foo)

The test validates class and instance calls with empty, positional, and keyword arguments.

@Hugo-Polloli
Hugo-Polloli marked this pull request as ready for review February 16, 2026 08:50
@Hugo-Polloli

Copy link
Copy Markdown
Contributor Author

astral-sh/ty#2724 (comment)
-> Pushing this small added mdtest to guard against future regression

@AlexWaygood AlexWaygood added testing Related to testing Ruff or ty ty The ty type checker labels Feb 16, 2026

@sharkdp sharkdp 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.

Thank you!

@sharkdp sharkdp self-assigned this Feb 16, 2026
@sharkdp
sharkdp merged commit 2b5d34f into astral-sh:main Feb 16, 2026
48 checks passed
carljm added a commit that referenced this pull request Feb 16, 2026
* main: (43 commits)
  [`ruff`] Suppress diagnostic for strings with backslashes in interpolations before Python 3.12 (`RUF027`) (#21069)
  [flake8-bugbear] Fix B023 false positive for immediately-invoked lambdas (#23294)
  [ty] Add `Final` mdtests for loops and redeclaration (#23331)
  [`flake8-pyi`] Also check string annotations (`PYI041`) (#19023)
  Remove AlexWaygood as a flake8-pyi codeowner (#23347)
  [ty] Add comments to clarify the purpose of `NominalInstanceType::class_name` and `NominalInstanceType::class_module_name` (#23339)
  Add attestations for release artifacts and Docker images (#23111)
  [ty] Fix `assert_type` diagnostic messages (#23342)
  [ty] Force-update all insta snapshots (#23343)
  Add Q004 to the list of conflicting rules (#23340)
  [ty] Fix `invalid-match-pattern` false positives (#23338)
  [ty] new diagnostic called-match-pattern-must-be-a-type (#22939)
  [ty] Update flaky projects  (#23337)
  [ty] Increase timeout for ecosystem report to 40 min (#23336)
  Bump ecosystem-analyzer pin  (#23335)
  [ty] Replace `strsim` with CPython-based Levenshtein implementation (#23291)
  [ty] Add mdtest for staticmethod assigned in class body (#23330)
  [ty] fix inferring type variable from string literal argument (#23326)
  [ty] bytes literal is a sequence of integers (#23329)
  Update rand and getrandom (#23333)
  ...
@Hugo-Polloli
Hugo-Polloli deleted the mdtest-staticmethod-assignment branch March 1, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff or ty ty The ty type checker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants