cobrateam / splinter

splinter - python test framework for web applications
http://splinter.readthedocs.org/en/stable/index.html
BSD 3-Clause "New" or "Revised" License
2.7k stars 502 forks source link

More type annotations? #1222

Open tony opened 6 months ago

tony commented 6 months ago

Request

I would be nice to have expanded type coverage.

History

Example scenario

Loosely, even if this isn't idiomatic splinter usage, I think the general benefits of annotations and typings still hold. I am fine to elaborate.

Specifically, I am running into any Any with BaseWebDriver's attribute .driver.

Where I have a function like:

def fill_helper(browser: BaseWebDriver, selectors_path: list[str], value: str) -> None:
    # ...
    pass

And mypy will raise:

.../test_website.py:31: error: Argument 1 to "fill_helper" becomes "Any" due to an unfollowed import  [no-any-unimported]

Not relevant, but happen to be using:

fsouza commented 5 months ago

I'm a big +1 on this, but I don't think I'll have time to work on it on the short term. It is something we can make incremental progress though.