Skip to content

Missing Attribute Error on pytest.fixture #6331

Closed
@MisterBianco

Description

@MisterBianco

Please provide more information to help us understand the issue:

This is potentially both a bug and a feature request.

@pytest.mark.incremental
@pytest.mark.usefixtures("driver")
class TestNeatLogin(object):
    def test_hello(self) -> None:

        self.driver << Neat().home_page
        assert "hi" in self.driver.url

self.driver is the pytest fixture from a conftest file and is just a wrapper for selenium (unimportant)

Output of mypy --disallow-untyped-defs --ignore-missing-imports test_neat.py:

test_neat.py:18: error: "TestNeatLogin" has no attribute "driver"

I was hoping it would detect the fixture and move on

Environ:

    mypy: 0.660
   python: 3.7

I can try installing from master if anyone feels like that will fix the issue, just curious what I can do to either: fix the issue or ignore these particular errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions