Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_update_data fails when -x is in PYTEST_ADDOPTS #16265

Open
mtelka opened this issue Oct 14, 2023 · 0 comments
Open

test_update_data fails when -x is in PYTEST_ADDOPTS #16265

mtelka opened this issue Oct 14, 2023 · 0 comments
Labels
bug mypy got something wrong topic-tests

Comments

@mtelka
Copy link
Contributor

mtelka commented Oct 14, 2023

Bug Report

When I run tests for mypy-1.6.0 and -x is in PYTEST_ADDOPTS then test_update_data fails.

To Reproduce

The following command fails:

PYTEST_ADDOPTS="-x" PATH=/usr/gcc/10/bin:$PATH /usr/bin/tox --recreate -e py39 -- mypy/test/meta/test_update_data.py -vv

Expected Behavior

Interestingly, the following passes (please note -x at the end of line):

PYTEST_ADDOPTS="" PATH=/usr/gcc/10/bin:$PATH /usr/bin/tox --recreate -e py39 -- mypy/test/meta/test_update_data.py -vv -x

Actual Behavior

The relevant part of the output:

E           [case testMissingMultiline]
E           s: str = 42;  i: int = 'foo'  # E: Incompatible types in assignment (expression has type "int", variable has type "str") \
E                                         # E: Incompatible types in assignment (expression has type "str", variable has type "int")
E
E           [case testExtraneous]
E         - s: str = 'foo'
E         + s: str = 'foo'  # E: wrong error
E
E           [case testExtraneousMultiline]
E         - s: str = 'foo'
E         + s: str = 'foo'  # E: foo                             # E: bar
E
E           [case testExtraneousMultilineNonError]
E         - s: str = 'foo'
E         + s: str = 'foo'  # W: foo                             # N: bar
E
E           [case testOutCorrect]
E           s: str = 42
E           [out]
E           main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
E
E           [case testOutWrong]
E           s: str = 42
E           [out]
E         - main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
E         + main:1: error: foobar
E
E           [case testOutWrongIncremental]
E           s: str = 42
E           [out]
E         - main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
E         + main:1: error: foobar
E           [out2]
E         - main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
E         + main:1: error: foobar
E
E           [case testWrongMultipleFiles]
E           import a, b
E         - s: str = 42  # E: Incompatible types in assignment (expression has type "int", variable has type "str")
E         + s: str = 42  # E: foo
E           [file a.py]
E         - s1: str = 42  # E: Incompatible types in assignment (expression has type "int", variable has type "str")
E         + s1: str = 42  # E: bar
E           [file b.py]
E         - s2: str = 43  # E: Incompatible types in assignment (expression has type "int", variable has type "str")
E         + s2: str = 43  # E: baz
E           [builtins fixtures/list.pyi]

Your Environment

  • Mypy version used: 1.6.0
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.9.16
@mtelka mtelka added the bug mypy got something wrong label Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-tests
Projects
None yet
Development

No branches or pull requests

2 participants