GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve tests of `typing.override` · Issue #102324 · python/cpython

Improve tests of typing.override  #102324

New issue
Copy link
New issue
Copy link
Closed
Closed
Improve tests of typing.override #102324
Copy link
Assignees
sobolevn
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@sobolevn
sobolevn
opened on Feb 28, 2023
Issue body actions

Right now we have several things to improve:

  1. This branch is not covered by tests:

    cpython/Lib/typing.py

    Line 3490 in 4c87537

    pass
    We don't have a single test that ensures that @override will not fail for some weird cases. Since 99.99% of use-cases will simply be @override def some(...): ..., it is not very important - but still desirable
  2. We don't test @classmethods, I guess it is special enough to be included
  3. @property is also missing from tests, but is mentioned in PEP: https://peps.python.org/pep-0698/#specification and https://peps.python.org/pep-0698/#limitations-of-setting-override
  4. PEP also mentions @functools.lru_cache and similar decorators as an example of how wrappers should be nested. Why don't we test it? Right now there are no tests for nested method decorators (except staticmethod)
  5. It might not hurt to test that parent's methods definitions are not mutated (I think this is a part of the contract)

PR is on its way :)

Linked PRs

  • gh-102324: Improve tests of typing.override #102325
Reacted by Alex Waygood and Steven Troxler

Activity

  1. sobolevn
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    on Feb 28, 2023
  2. sobolevn
    self-assigned this
    on Feb 28, 2023
  3. sobolevn
    added a commit that references this issue on Feb 28, 2023

    pythongh-102324: Improve tests of `typing.override`

    e350c42
  4. AlexWaygood
    added
    topic-typing
    on Feb 28, 2023
  5. JelleZijlstra
    added a commit that references this issue on Mar 3, 2023

    gh-102324: Improve tests of `typing.override` (#102325)

    12011dd
  6. sobolevn
    closed this as completedon Mar 3, 2023
  7. carljm
    added a commit that references this issue on Mar 4, 2023

    Merge branch 'main' into nodeaddict

    a31af32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @sobolevn
    sobolevn

Labels

testsTests in the Lib/test dirTests in the Lib/test dirtopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.