Coder Social home page Coder Social logo

Comments (4)

seifertm avatar seifertm commented on May 27, 2024

Thanks. Pytest-asyncio is currently type checked with an outdated version of mypy. There's an issue to update the type checker: #596

I assume it would be helpful to also type check with pyright in the CI.

Since pytest-asyncio v0.23 has functional issues that break some users' test suites, the typing issue you describe is not at the top of my priorities list at the moment. I hope you understand!

from pytest-asyncio.

seifertm avatar seifertm commented on May 27, 2024

@charles-dyfis-net pytest-asyncio-0.23.5a0 fixed some typing issues and removed the unbound type variable _R in the process. Can you try the pre release and check if it resolves your issue?

from pytest-asyncio.

charles-dyfis-net avatar charles-dyfis-net commented on May 27, 2024

We're not running clean, but the specific issue this ticket was filed for is no longer present:

pytest-asyncio/pytest_asyncio/plugin.py
  pytest-asyncio/pytest_asyncio/plugin.py:401:13 - error: Argument of type "Node | None" cannot be assigned to parameter "parent" of type "Node" in function "from_parent"
    Type "Node | None" cannot be assigned to type "Node"
      "None" is incompatible with "Node" (reportGeneralTypeIssues)
  pytest-asyncio/pytest_asyncio/plugin.py:652:30 - error: Cannot access member "__original_collect" for type "Module"
    Member "__original_collect" is unknown (reportGeneralTypeIssues)
pytest-asyncio/tests/test_is_async_test.py
  pytest-asyncio/tests/test_is_async_test.py:77:8 - error: Operator "<" not supported for types "tuple[Literal[7], Literal[4], Literal[0]]" and "tuple[Literal[7], Literal[2]]" (reportGeneralTypeIssues)
  pytest-asyncio/tests/test_is_async_test.py:80:10 - error: Operator "<" not supported for types "tuple[Literal[7], Literal[4], Literal[0]]" and "tuple[Literal[8]]" (reportGeneralTypeIssues)
pytest-asyncio/tests/hypothesis/test_base.py
  pytest-asyncio/tests/hypothesis/test_base.py:8:24 - error: "given" is unknown import symbol (reportGeneralTypeIssues)
  pytest-asyncio/tests/hypothesis/test_base.py:8:31 - error: "strategies" is unknown import symbol (reportGeneralTypeIssues)
6 errors, 0 warnings, 0 informations 

from pytest-asyncio.

seifertm avatar seifertm commented on May 27, 2024

Thanks for checking.

Resolving this issue would make for suitable first contribution to pytest-asyncio. I don't necessarily mean you, but anyone who is interested in working on this.

If anyone wants to open a PR, I would expect:

  • A pyright pre-commit hook to be added to .pre-commit-config.yaml. This will run pyright on every commit and prevent this kind of issue in the future
  • the docs and tests folders to be excluded from the pyright type check (see configuration of the mypy pre-commit hook)
  • The two typing errors to be fixed

from pytest-asyncio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.