`test_update_data` fails when `-x` is in `PYTEST_ADDOPTS`
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 20.6k
- Forks
- 3.3k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza ejecutando el comando tox reportado contra mypy/test/meta/test_update_data.py y compáralo después con el comando que pasa cuando se proporciona -x al final. Inspecciona cómo maneja este test las opciones de pytest y actualiza su comportamiento para que el test pase tanto con -x en PYTEST_ADDOPTS como en la línea de comandos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- testing-qa
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100