You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Reproduce
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
install .whl file in </install/prefix> using installer module
run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
Expected Behavior
pytest should not fail.
Actual Behavior
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-mypy-1.10.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-mypy-1.10.1-2.fc37.x86_64/usr/lib/python3.10/site-packages+ /usr/bin/pytest -ra -m 'not network'==================================================================================== test session starts ====================================================================================platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1configfile: pyproject.tomltestpaths: mypy/test, mypyc/testplugins: forked-1.6.0collected 12054 itemsmypy/test/meta/test_diff_helper.py .. [ 0%]mypy/test/meta/test_parse_data.py FFFF [ 0%]mypy/test/meta/test_update_data.py F [ 0%]mypy/test/test_find_sources.py ......... [ 0%]mypy/test/test_ref_info.py ..... [ 0%]mypy/test/testapi.py .... [ 0%]mypy/test/testargs.py .. [ 0%]mypy/test/testcheck.py .............................................................................................................................................................. [ 1%]..................................................................................................................................................................................... [ 3%]..................................................................................................................................................................................... [ 4%]..................................................................................................................................................................................... [ 6%]..................................................................................................................x.................................................................. [ 7%]..................................................................................................................................................................................... [ 9%]..................................................................................................................................................................................... [ 10%]..................................................................................................................................................................................... [ 12%]..................................................................................................................................................................................... [ 13%]..................................................................................................................................................................................... [ 15%]..................................................................................................................................................................................... [ 16%]..................................................................................................................................................................................... [ 18%].................................................................s..................................................................................................s................ [ 19%].................s................................................................................................................................................................... [ 21%]..............................................................................................................ss................................s.................................... [ 22%]..................................................................................................................................................................................... [ 24%].........................................s................................................................................................s.......................................... [ 25%]..................................................................................................................................................................................... [ 27%]..................................................................................................................................................................................... [ 28%].............................................................s....................................................................................................................... [ 30%]..................................................................................................................................................................................... [ 31%]..................................................................................................................................................................................... [ 33%]..................................................................................................................................................................................... [ 34%]..................................................................................................................................................................................... [ 36%]..................................................................................................................................................................................... [ 37%]............................................................................................s........................................................................................ [ 39%]..................................................................................................................................................................................... [ 40%]................................................................................................................s.................................................................... [ 42%]...................................................................s.........................s...............................................................................s.....s. [ 43%]s......................................................................................s....................................................................................s........ [ 45%]..................................................................................................................................................................................... [ 46%]............................xx....................................................................................................................................................... [ 48%]..................................................................................................................................................................................... [ 49%]..................................................................................................................................................................................... [ 51%]..................................................................................................................................................................................... [ 52%]......................x.............................................................................................................................................................. [ 54%]..........................................................................................................................x.......................................................... [ 55%]..................................................................................................................................................................................... [ 57%]............ [ 57%]mypy/test/testcmdline.py ..................................................................................................................................................... [ 58%]mypy/test/testconstraints.py .......... [ 58%]mypy/test/testdaemon.py ........................... [ 58%]mypy/test/testdeps.py ............................................................................................................................................................... [ 60%]....................................................................... [ 60%]mypy/test/testdiff.py .......................................................................... [ 61%]mypy/test/testerrorstream.py ... [ 61%]mypy/test/testfinegrained.py ..s............s........s................................s...s.....ss..........................................s........................................ [ 62%]..ssssssss...........s................s.................s..........................................................................s................................................. [ 64%]........................................................................................................................................................................s............ [ 65%]....................................................s.....................s..............................................s.........................................................s. [ 67%]....................... [ 67%]mypy/test/testfinegrainedcache.py .......s.s....s....s..s.ss..........s...s.s...ss...ssssss.sss.sssss..s......................s...ssss.s.ss.....ss....s......ssss..sss..sssssss...s.. [ 68%]..................sssss...s.....s........s.s.................s..s..sss.sssssssssssss.ss.sssssssssssssssssssssssssssss..................s..sss..s.s................................... [ 69%]..............sss.........sss..sssssssss.........s....ssssss.s...ss....ss..s........................................s.s.s.......s.sss.s........s....s..............s....s....s....... [ 71%]..........................sss....ss........s.....s....s.ss......................s....ssssss.ssssssssss...........ss............s.......s..s...s.s.s.....ss..s............ssss........ [ 72%]....ss......s...ssss.s.......... [ 73%]mypy/test/testformatter.py .. [ 73%]mypy/test/testfscache.py .... [ 73%]mypy/test/testgraph.py .... [ 73%]mypy/test/testinfer.py ......................... [ 73%]mypy/test/testipc.py s... [ 73%]mypy/test/testmerge.py ......................................s.... [ 73%]mypy/test/testmodulefinder.py ................ [ 74%]mypy/test/testmypyc.py . [ 74%]mypy/test/testparse.py .............................................................................................................................................................. [ 75%].............................................................................sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 76%]mypy/test/testpep561.py ................. [ 76%]mypy/test/testpythoneval.py .......................................................................................x................................................................. [ 78%]..... [ 78%]mypy/test/testreports.py .. [ 78%]mypy/test/testsemanal.py ............................................................................................................................................................ [ 79%]..................................................................................................................................................................................... [ 80%]..................................................................................................................................................................................... [ 82%]...................................................... [ 82%]mypy/test/testsolve.py ...................... [ 83%]mypy/test/teststubgen.py ......s......................................................................................................................x....................ss........ [ 84%]..................................................................................................................................................................................... [ 85%]............ [ 85%]mypy/test/teststubinfo.py . [ 85%]mypy/test/teststubtest.py ...................................................... [ 86%]mypy/test/testsubtypes.py ......................... [ 86%]mypy/test/testtransform.py .......................................................................................................................................................... [ 87%]................................................................................................................ [ 88%]mypy/test/testtypegen.py .....................s..................................................... [ 89%]mypy/test/testtypes.py .........................................................s.......s.................................................... [ 90%]mypy/test/testutil.py ...... [ 90%]mypyc/test/test_alwaysdefined.py .......... [ 90%]mypyc/test/test_analysis.py ................ [ 90%]mypyc/test/test_cheader.py . [ 90%]mypyc/test/test_commandline.py .s.. [ 90%]mypyc/test/test_emit.py ...... [ 90%]mypyc/test/test_emitclass.py ... [ 90%]mypyc/test/test_emitfunc.py ............................................................... [ 91%]mypyc/test/test_emitwrapper.py .. [ 91%]mypyc/test/test_exceptions.py ..................... [ 91%]mypyc/test/test_external.py . [ 91%]mypyc/test/test_irbuild.py .......................................................................................................................................................... [ 92%]..................................................................................................................................................................................... [ 94%]..................................................................................................................................................................... [ 95%]mypyc/test/test_ircheck.py ............ [ 95%]mypyc/test/test_literals.py ...... [ 95%]mypyc/test/test_lowering.py ............ [ 95%]mypyc/test/test_namegen.py .... [ 95%]mypyc/test/test_optimizations.py ...................... [ 96%]mypyc/test/test_pprint.py .... [ 96%]mypyc/test/test_rarray.py ...... [ 96%]mypyc/test/test_refcount.py ............................................................. [ 96%]mypyc/test/test_run.py .............................................................................................................................................................. [ 97%]................................................................................................................................................xx................................... [ 99%]............................................. [ 99%]mypyc/test/test_struct.py .... [ 99%]mypyc/test/test_tuplename.py . [ 99%]mypyc/test/test_typeops.py ............ [100%]========================================================================================= FAILURES ==========================================================================================_______________________________________________________________________ ParseTestDataSuite.test_bad_eq_version_check ________________________________________________________________________self = <mypy.test.meta.test_parse_data.ParseTestDataSuite testMethod=test_bad_eq_version_check> def test_bad_eq_version_check(self) -> None: # Act actual = _run_pytest( """ [case abc] s: str [out version==3.7] abc """ ) # Assert
> assert "version==3.7 always false since minimum runtime version is (3, 8)"in actual.stdoutE AssertionError: assert 'version==3.7 always false since minimum runtime version is (3, 8)' in ''E + where '' = PytestResult(input='[case abc]\ns: str\n[out version==3.7]\nabc\n', input_updated='[case abc]\ns: str\n[out version==3...e: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml\n rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1\n\n').stdoutmypy/test/meta/test_parse_data.py:73: AssertionError----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------>> /usr/bin/python3 -m pytest -n 0 -s mypy/test/testcheck.py::TypeCheckSuite::check-meta-454810c4-374d-4ed0-a69f-7496d7c10d06.testNESTED PYTEST STDERR: ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] : __main__.py: error: unrecognized arguments: -n mypy/test/testcheck.py::TypeCheckSuite::check-meta-454810c4-374d-4ed0-a69f-7496d7c10d06.test : inifile: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml : rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1 :Exit code 4 (0 attempts remaining)_______________________________________________________________________ ParseTestDataSuite.test_bad_ge_version_check ________________________________________________________________________self = <mypy.test.meta.test_parse_data.ParseTestDataSuite testMethod=test_bad_ge_version_check> def test_bad_ge_version_check(self) -> None: # Act actual = _run_pytest( """ [case abc] s: str [out version>=3.8] abc """ ) # Assert
> assert "version>=3.8 always true since minimum runtime version is (3, 8)"in actual.stdoutE AssertionError: assert 'version>=3.8 always true since minimum runtime version is (3, 8)' in ''E + where '' = PytestResult(input='[case abc]\ns: str\n[out version>=3.8]\nabc\n', input_updated='[case abc]\ns: str\n[out version>=3...e: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml\n rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1\n\n').stdoutmypy/test/meta/test_parse_data.py:59: AssertionError----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------>> /usr/bin/python3 -m pytest -n 0 -s mypy/test/testcheck.py::TypeCheckSuite::check-meta-5dfd4080-53cd-471a-a42b-4d15a252b5f4.testNESTED PYTEST STDERR: ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] : __main__.py: error: unrecognized arguments: -n mypy/test/testcheck.py::TypeCheckSuite::check-meta-5dfd4080-53cd-471a-a42b-4d15a252b5f4.test : inifile: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml : rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1 :Exit code 4 (0 attempts remaining)________________________________________________________________________ ParseTestDataSuite.test_parse_invalid_case _________________________________________________________________________self = <mypy.test.meta.test_parse_data.ParseTestDataSuite testMethod=test_parse_invalid_case> def test_parse_invalid_case(self) -> None: # Act result = _run_pytest( """ [case abc] s: str [case foo-XFAIL] s: str """ ) # Assert
> assert "Invalid testcase id 'foo-XFAIL'"in result.stdoutE assert "Invalid testcase id 'foo-XFAIL'" in ''E + where '' = PytestResult(input='[case abc]\ns: str\n[case foo-XFAIL]\ns: str\n', input_updated='[case abc]\ns: str\n[case foo-XFAI...e: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml\n rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1\n\n').stdoutmypy/test/meta/test_parse_data.py:27: AssertionError----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------>> /usr/bin/python3 -m pytest -n 0 -s mypy/test/testcheck.py::TypeCheckSuite::check-meta-18f269fa-6498-4ce9-a65a-fafc707d96b2.testNESTED PYTEST STDERR: ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] : __main__.py: error: unrecognized arguments: -n mypy/test/testcheck.py::TypeCheckSuite::check-meta-18f269fa-6498-4ce9-a65a-fafc707d96b2.test : inifile: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml : rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1 :Exit code 4 (0 attempts remaining)_______________________________________________________________________ ParseTestDataSuite.test_parse_invalid_section _______________________________________________________________________self = <mypy.test.meta.test_parse_data.ParseTestDataSuite testMethod=test_parse_invalid_section> def test_parse_invalid_section(self) -> None: # Act result = _run_pytest( """ [case abc] s: str [unknownsection] abc """ ) # Assert expected_lineno = result.input.splitlines().index("[unknownsection]") + 1 expected = ( f".test:{expected_lineno}: Invalid section header [unknownsection] in case 'abc'" )
> assert expected in result.stdoutE assert ".test:3: Invalid section header [unknownsection] in case 'abc'" in ''E + where '' = PytestResult(input='[case abc]\ns: str\n[unknownsection]\nabc\n', input_updated='[case abc]\ns: str\n[unknownsection]\...e: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml\n rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1\n\n').stdoutmypy/test/meta/test_parse_data.py:45: AssertionError----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------>> /usr/bin/python3 -m pytest -n 0 -s mypy/test/testcheck.py::TypeCheckSuite::check-meta-8cdadb5b-dfbd-4826-b850-5a531a781af1.testNESTED PYTEST STDERR: ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] : __main__.py: error: unrecognized arguments: -n mypy/test/testcheck.py::TypeCheckSuite::check-meta-8cdadb5b-dfbd-4826-b850-5a531a781af1.test : inifile: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml : rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1 :Exit code 4 (0 attempts remaining)_____________________________________________________________________________ UpdateDataSuite.test_update_data ______________________________________________________________________________self = <mypy.test.meta.test_update_data.UpdateDataSuite testMethod=test_update_data> def test_update_data(self) -> None: # Note: We test multiple testcases rather than 'test case per test case' # so we could also exercise rewriting multiple testcases at once. result = _run_pytest_update_data( """ [case testCorrect] s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") [case testWrong] s: str = 42 # E: wrong error [case testXfail-xfail] s: str = 42 # E: wrong error [case testWrongMultiline] s: str = 42 # E: foo \ # N: bar [case testMissingMultiline] s: str = 42; i: int = 'foo' [case testExtraneous] s: str = 'foo' # E: wrong error [case testExtraneousMultiline] s: str = 'foo' # E: foo \ # E: bar [case testExtraneousMultilineNonError] s: str = 'foo' # W: foo \ # N: bar [case testOutCorrect] s: str = 42 [out] main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str") [case testOutWrong] s: str = 42 [out] main:1: error: foobar [case testOutWrongIncremental] s: str = 42 [out] main:1: error: foobar [out2] main:1: error: foobar [case testWrongMultipleFiles] import a, b s: str = 42 # E: foo [file a.py] s1: str = 42 # E: bar [file b.py] s2: str = 43 # E: baz [builtins fixtures/list.pyi] """ ) # Assert expected = dedent_docstring( """ [case testCorrect] s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") [case testWrong] s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") [case testXfail-xfail] s: str = 42 # E: wrong error [case testWrongMultiline] s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") [case testMissingMultiline] s: str = 42; i: int = 'foo' # E: Incompatible types in assignment (expression has type "int", variable has type "str") \\ # E: Incompatible types in assignment (expression has type "str", variable has type "int") [case testExtraneous] s: str = 'foo' [case testExtraneousMultiline] s: str = 'foo' [case testExtraneousMultilineNonError] s: str = 'foo' [case testOutCorrect] s: str = 42 [out] main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str") [case testOutWrong] s: str = 42 [out] main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str") [case testOutWrongIncremental] s: str = 42 [out] main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str") [out2] main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str") [case testWrongMultipleFiles] import a, b s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") [file a.py] s1: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") [file b.py] s2: str = 43 # E: Incompatible types in assignment (expression has type "int", variable has type "str") [builtins fixtures/list.pyi] """ )
> assert result.input_updated == expectedE assert '[case testCo...s/list.pyi]\n' == '[case testCo...s/list.pyi]\n'EE Skipping 149 identical leading characters in diff, use -v to showE - 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str")E + 42 # E: wrong errorEE [case testXfail-xfail]E s: str = 42 # E: wrong error...EE ...Full output truncated (53 lines hidden), use '-vv' to showmypy/test/meta/test_update_data.py:135: AssertionError----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------>> /usr/bin/python3 -m pytest -n 0 -s --update-data mypy/test/testcheck.py::TypeCheckSuite::check-meta-91507aee-9232-4c2e-870d-74c84377c60b.testNESTED PYTEST STDERR: ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] : __main__.py: error: unrecognized arguments: -n mypy/test/testcheck.py::TypeCheckSuite::check-meta-91507aee-9232-4c2e-870d-74c84377c60b.test : inifile: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml : rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1 :Exit code 4 (2 attempts remaining)>> /usr/bin/python3 -m pytest -n 0 -s --update-data mypy/test/testcheck.py::TypeCheckSuite::check-meta-91507aee-9232-4c2e-870d-74c84377c60b.testNESTED PYTEST STDERR: ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] : __main__.py: error: unrecognized arguments: -n mypy/test/testcheck.py::TypeCheckSuite::check-meta-91507aee-9232-4c2e-870d-74c84377c60b.test : inifile: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml : rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1 :Exit code 4 (1 attempts remaining)>> /usr/bin/python3 -m pytest -n 0 -s --update-data mypy/test/testcheck.py::TypeCheckSuite::check-meta-91507aee-9232-4c2e-870d-74c84377c60b.testNESTED PYTEST STDERR: ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...] : __main__.py: error: unrecognized arguments: -n mypy/test/testcheck.py::TypeCheckSuite::check-meta-91507aee-9232-4c2e-870d-74c84377c60b.test : inifile: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/pyproject.toml : rootdir: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1 :Exit code 4 (0 attempts remaining)========================================================================================= XFAILURES =========================================================================================________________________________________________________________________________ testOpWithInheritedFromAny _________________________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-classes.test:7432:Failed: Unexpected type checker output (/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-classes.test, line 7432)----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------Expected: main:10: note: Revealed type is "Any" main:12: note: Revealed type is "Any" (diff) main:13: note: Revealed type is "Any" main:14: note: Revealed type is "builtins.str" main:15: note: Revealed type is "Any" main:18: note: Revealed type is "Any" (diff) main:19: note: Revealed type is "__main__.D1"Actual: main:10: note: Revealed type is "Any" main:12: note: Revealed type is "builtins.float" (diff) main:13: note: Revealed type is "Any" main:14: note: Revealed type is "builtins.str" main:15: note: Revealed type is "Any" main:18: note: Revealed type is "builtins.float" (diff) main:19: note: Revealed type is "__main__.D1"Alignment of first line difference: E: ...ote: Revealed type is "Any" A: ...ote: Revealed type is "builtins.float" ^Update the test output using --update-data -n0 (you can additionally use the -k selector to update only specific tests)______________________________________________________________________ testImplementationHasSameDispatchTypeAsFallback ______________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-singledispatch.test:56:Failed: Unexpected type checker output (/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-singledispatch.test, line 56)----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------Expected: main:5: error: singledispatch implementation 1 will never be used: implementation 2's dispatch type is the same (diff)Actual:Update the test output using --update-data -n0 (you can additionally use the -k selector to update only specific tests)_______________________________________________________________________ testRegisterHasDifferentTypeThanTypeSignature _______________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-singledispatch.test:70:Failed: Unexpected type checker output (/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-singledispatch.test, line 70)----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------Expected: main:8: error: Argument to register "str" is incompatible with type "int" in function signature (diff)Actual:Update the test output using --update-data -n0 (you can additionally use the -k selector to update only specific tests)______________________________________________________________________________ testTypeGuardMultipleCondition _______________________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-typeguard.test:449:Failed: Unexpected type checker output (/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-typeguard.test, line 449)----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------Expected: main:16: note: Revealed type is "__main__.<subclass of "Foo" and "Bar">" main:21: note: Revealed type is "__main__.<subclass of "Foo" and "Bar">" (diff)Actual: main:16: note: Revealed type is "__main__.<subclass of "Foo" and "Bar">" main:21: note: Revealed type is "__main__.Bar" (diff)Alignment of first line difference: E: ...led type is "__main__.<subclass of "Foo" and "Bar">" A: ...led type is "__main__.Bar" ^Update the test output using --update-data -n0 (you can additionally use the -k selector to update only specific tests)_____________________________________________________________________ testImplicit604TypeAliasWithCyclicImportNotInStub _____________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-union-or-syntax.test:212:Failed: Unexpected type checker output (/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/check-union-or-syntax.test, line 212)----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------Expected: main:3: note: Revealed type is "Union[builtins.str, was_mmap.mmap]" (diff)Actual: tmp/was_builtins.py:3: error: Unsupported left operand type for | ("Type[str]") (diff) tmp/was_builtins.py:4: error: Variable "was_builtins.ReadableBuffer" is not valid as a type (diff) tmp/was_builtins.py:4: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases (diff) main:3: note: Revealed type is "ReadableBuffer?" (diff)Alignment of first line difference: E: main:3: note: Revealed type is "Union[builtins.str, was_mmap.mmap]"... A: tmp/was_builtins.py:3: error: Unsupported left operand type for | ("Type... ^Update the test output using --update-data -n0 (you can additionally use the -k selector to update only specific tests)_______________________________________________________________________________ testAsyncioGatherPreciseType ________________________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/pythoneval.test:1157:Failed: Invalid output (/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/pythoneval.test, line 1157)----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------Expected: _testAsyncioGatherPreciseType.py:9: note: Revealed type is "builtins.str" (diff) _testAsyncioGatherPreciseType.py:10: note: Revealed type is "builtins.str" _testAsyncioGatherPreciseType.py:11: note: Revealed type is "asyncio.futures.Future[builtins.list[Any]]" (diff)Actual: _testAsyncioGatherPreciseType.py:10: note: Revealed type is "builtins.str" _testAsyncioGatherPreciseType.py:11: note: Revealed type is "builtins.str" (diff) _testAsyncioGatherPreciseType.py:12: note: Revealed type is "asyncio.futures.Future[builtins.list[None]]" (diff)Alignment of first line difference: E: ...ioGatherPreciseType.py:9: note: Revealed type is "builtins.str" A: ...ioGatherPreciseType.py:10: note: Revealed type is "builtins.str" ^Update the test output using --update-data -n0 (you can additionally use the -k selector to update only specific tests)____________________________________________________________________________ testNestedClassInNamedTuple_semanal ____________________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/stubgen.test:955:Failed: Invalid output (/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/test-data/unit/stubgen.test, line 955)----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------Expected: from typing import NamedTuple class NamedTupleWithNestedClass(NamedTuple): (diff) class Nested: (diff) x: int (diff) y: str (diff)Actual: from typing import NamedTuple class NamedTupleWithNestedClass(NamedTuple): ... (diff)Alignment of first line difference: E: ...NestedClass(NamedTuple): A: ...NestedClass(NamedTuple): ... ^Update the test output using --update-data -n0 (you can additionally use the -k selector to update only specific tests)_________________________________________________________________________________ testSingleDispatchMethod __________________________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test-data/run-singledispatch.test:195:/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test/test_run.py:234: in run_case_step result = emitmodule.parse_and_typecheck(/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/codegen/emitmodule.py:197: in parse_and_typecheck raise CompileError(result.errors)E mypy.errors.CompileError: native.py:1: error: Module "functools" has no attribute "singledispatchmethod"; maybe "singledispatch"? [attr-defined]During handling of the above exception, another exception occurred:/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test/test_run.py:148: in run_case self.run_case_inner(testcase)/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test/test_run.py:164: in run_case_inner self.run_case_step(testcase, step)/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test/test_run.py:251: in run_case_step assert False, "Compile error"E AssertionError: Compile errorE assert False----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------run-singledispatch.test:196: error: Module "functools" has no attribute "singledispatchmethod"; maybe "singledispatch"? [attr-defined]________________________________________________________________________ testSingleDispatchMethodWithOtherDecorator _________________________________________________________________________data: /home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test-data/run-singledispatch.test:216:/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test/test_run.py:234: in run_case_step result = emitmodule.parse_and_typecheck(/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/codegen/emitmodule.py:197: in parse_and_typecheck raise CompileError(result.errors)E mypy.errors.CompileError: native.py:1: error: Module "functools" has no attribute "singledispatchmethod"; maybe "singledispatch"? [attr-defined]During handling of the above exception, another exception occurred:/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test/test_run.py:148: in run_case self.run_case_inner(testcase)/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test/test_run.py:164: in run_case_inner self.run_case_step(testcase, step)/home/tkloczko/rpmbuild/BUILD/mypy-1.10.1/mypyc/test/test_run.py:251: in run_case_step assert False, "Compile error"E AssertionError: Compile errorE assert False----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------run-singledispatch.test:217: error: Module "functools" has no attribute "singledispatchmethod"; maybe "singledispatch"? [attr-defined]================================================================================== short test summary info ==================================================================================SKIPPED [33] mypy/test/data.py:311: SkippedSKIPPED [223] mypy/test/testfinegrained.py:76: SkippedSKIPPED [1] mypy/test/testipc.py:104: unconditional skipSKIPPED [71] mypy/test/testparse.py:87: SkippedSKIPPED [1] mypy/test/teststubgen.py:597: Tests building the paths common ancestor on WindowsSKIPPED [2] mypy/test/teststubgen.py:704: SkippedSKIPPED [1] mypy/test/testtypes.py:923: unconditional skipSKIPPED [1] mypy/test/testtypes.py:915: unconditional skipXFAIL mypy/test/testcheck.py::TypeCheckSuite::check-classes.test::testOpWithInheritedFromAnyXFAIL mypy/test/testcheck.py::TypeCheckSuite::check-singledispatch.test::testImplementationHasSameDispatchTypeAsFallbackXFAIL mypy/test/testcheck.py::TypeCheckSuite::check-singledispatch.test::testRegisterHasDifferentTypeThanTypeSignatureXFAIL mypy/test/testcheck.py::TypeCheckSuite::check-typeguard.test::testTypeGuardMultipleConditionXFAIL mypy/test/testcheck.py::TypeCheckSuite::check-union-or-syntax.test::testImplicit604TypeAliasWithCyclicImportNotInStubXFAIL mypy/test/testpythoneval.py::PythonEvaluationSuite::pythoneval.test::testAsyncioGatherPreciseTypeXFAIL mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testNestedClassInNamedTuple_semanalXFAIL mypyc/test/test_run.py::TestRun::run-singledispatch.test::testSingleDispatchMethodXFAIL mypyc/test/test_run.py::TestRun::run-singledispatch.test::testSingleDispatchMethodWithOtherDecoratorFAILED mypy/test/meta/test_parse_data.py::ParseTestDataSuite::test_bad_eq_version_check - AssertionError: assert 'version==3.7 always false since minimum runtime version is (3, 8)' in ''FAILED mypy/test/meta/test_parse_data.py::ParseTestDataSuite::test_bad_ge_version_check - AssertionError: assert 'version>=3.8 always true since minimum runtime version is (3, 8)' in ''FAILED mypy/test/meta/test_parse_data.py::ParseTestDataSuite::test_parse_invalid_case - assert "Invalid testcase id 'foo-XFAIL'" in ''FAILED mypy/test/meta/test_parse_data.py::ParseTestDataSuite::test_parse_invalid_section - assert ".test:3: Invalid section header [unknownsection] in case 'abc'" in ''FAILED mypy/test/meta/test_update_data.py::UpdateDataSuite::test_update_data - assert '[case testCo...s/list.pyi]\n' == '[case testCo...s/list.pyi]\n'=========================================================== 5 failed, 11707 passed, 333 skipped, 9 xfailed in 4772.95s (1:19:32) ============================================================
Your Environment
Mypy version used: 1.10.1
Mypy command-line flags: N/A
Mypy configuration options from mypy.ini (and other config files): N/A
I was not able to reproduce the (non-expected) failures on Python 3.12.8 and Mypy 1.16.0+dev.2ae3316e37ad1a9759d4fae0a9fd7199b5cfad74.dirty (compiled: no) on Windows 10. @kloczek do you still get them?
@kloczek For now I'm closing this issue as stale with no repro. if you're still experiencing this issue and can provide more details to help us reproduce it, we can reopen
Bug Report
Looks like pytest fails in few units.
To Reproduce
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesinstaller
modulecut off from access to the public network
(pytest is executed with-m "not network"
)Expected Behavior
pytest should not fail.
Actual Behavior
Here is pytest output:
Your Environment
mypy.ini
(and other config files): N/AList of installed modules in build env:
Please let me know if you need more details or want me to perform some diagnostics.
The text was updated successfully, but these errors were encountered: