A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/davidfritzsche/pytest-mypy-testing/issues/29 below:

Handling of long lines · Issue #29 · davidfritzsche/pytest-mypy-testing · GitHub

In certain cases, we have a mypy assertion like:

@pytest.mark.mypy_testing
def test_foo():
    link = Link()
    link1.url = 123  # E: Incompatible types in assignment (expression has type "int", variable has type "Optional[str]")

However, the last line already covers 122-characters. When using Black (which has a default of 88 chars - reference), it'd turn something like:

@pytest.mark.mypy_testing
def test_foo():
    link = Link()
    link1.url = (
        123
    )  # E: Incompatible types in assignment (expression has type "int", variable has type "Optional[str]")

The issue with this new format is that pytest would error out with something like:

5: error (unexpected): Incompatible types in assignment (expression has type "int", variable has type "Optional[str]")
6: error (missing): Incompatible types in assignment (expression has type "int", variable has type "Optional[str]")

Perhaps there should be another interface that could help declare the assertions aside from comments? or maybe, it should be possible to breakdown the comments into multi-line chunks?

kmike, Gallaecio, davidfritzsche, cdleonard, Suor and 1 more


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4