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
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>
run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-mypy-0.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-mypy-0.9.1-2.fc35.x86_64/usr/lib/python3.8/site-packages+ /usr/bin/pytest -ra=========================================================================== test session starts ============================================================================platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-mypy-0.9.1, configfile: tox.ini, testpaths: testsplugins: mypy-0.9.1, forked-1.4.0, xdist-2.5.0collected 53 itemstests/test_pytest_mypy.py ....................................FFFFFF........... [100%]================================================================================= FAILURES =================================================================================____________________________________________________________________ test_mypy_indirect[True-__init__] _____________________________________________________________________testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect0')>, xdist_args = ['-n', 'auto'], module_name = '__init__' @pytest.mark.parametrize( "module_name", [ pytest.param( "__init__", marks=pytest.mark.xfail( (3, 10) <= PYTEST_VERSION < (6, 2), raises=AssertionError, reason="https://github.com/pytest-dev/pytest/issues/8016", ), ), "good", ], ) def test_mypy_indirect(testdir, xdist_args, module_name): """Verify that uncollected files checked by mypy cause a failure.""" testdir.makepyfile( bad=""" def pyfunc(x: int) -> str: return x * 2 """, ) pyfile = testdir.makepyfile( **{ module_name: """ import bad """, }, ) result = testdir.runpytest_subprocess("--mypy", *xdist_args, str(pyfile)) mypy_file_checks = 1 mypy_status_check = 1
> result.assert_outcomes(passed=mypy_file_checks, failed=mypy_status_check)E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}E Omitting 4 identical items, use -vv to showE Differing items:E {'passed': 2} != {'passed': 1}E {'failed': 0} != {'failed': 1}E Use -v to get more diff/home/tkloczko/rpmbuild/BUILD/pytest-mypy-0.9.1/tests/test_pytest_mypy.py:310: AssertionError--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------running: /usr/bin/python3 -mpytest --basetemp=/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect0/runpytest-0 --mypy -n auto /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect0/__init__.py in: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect0============================= test session starts ==============================platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0rootdir: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect0plugins: mypy-0.9.1, forked-1.4.0, xdist-2.5.0gw0 I / gw1 I / gw2 I / gw3 I / gw4 I / gw5 I / gw6 I / gw7 I / gw8 I / gw9 I / gw10 I / gw11 I / gw12 I / gw13 I / gw14 I / gw15 I / gw16 I / gw17 I / gw18 I / gw19 I / gw20 I / gw21 I / gw22 I / gw23 I / gw24 I / gw25 I / gw26 I / gw27 I / gw28 I / gw29 I / gw30 I / gw31 I / gw32 I / gw33 I / gw34 I / gw35 I / gw36 I / gw37 I / gw38 I / gw39 I / gw40 I / gw41 I / gw42 I / gw43 I / gw44 I / gw45 I / gw46 I / gw47 Igw0 [2] / gw1 [2] / gw2 [2] / gw3 [2] / gw4 [2] / gw5 [2] / gw6 [2] / gw7 [2] / gw8 [2] / gw9 [2] / gw10 [2] / gw11 [2] / gw12 [2] / gw13 [2] / gw14 [2] / gw15 [2] / gw16 [2] / gw17 [2] / gw18 [2] / gw19 [2] / gw20 [2] / gw21 [2] / gw22 [2] / gw23 [2] / gw24 [2] / gw25 [2] / gw26 [2] / gw27 [2] / gw28 [2] / gw29 [2] / gw30 [2] / gw31 [2] / gw32 [2] / gw33 [2] / gw34 [2] / gw35 [2] / gw36 [2] / gw37 [2] / gw38 [2] / gw39 [2] / gw40 [2] / gw41 [2] / gw42 [2] / gw43 [2] / gw44 [2] / gw45 [2] / gw46 [2] / gw47 [2].. [100%]===================================== mypy =====================================Success: no issues found in 1 source file============================== 2 passed in 7.70s ===============================______________________________________________________________________ test_mypy_indirect[True-good] _______________________________________________________________________testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect1')>, xdist_args = ['-n', 'auto'], module_name = 'good' @pytest.mark.parametrize( "module_name", [ pytest.param( "__init__", marks=pytest.mark.xfail( (3, 10) <= PYTEST_VERSION < (6, 2), raises=AssertionError, reason="https://github.com/pytest-dev/pytest/issues/8016", ), ), "good", ], ) def test_mypy_indirect(testdir, xdist_args, module_name): """Verify that uncollected files checked by mypy cause a failure.""" testdir.makepyfile( bad=""" def pyfunc(x: int) -> str: return x * 2 """, ) pyfile = testdir.makepyfile( **{ module_name: """ import bad """, }, ) result = testdir.runpytest_subprocess("--mypy", *xdist_args, str(pyfile)) mypy_file_checks = 1 mypy_status_check = 1
> result.assert_outcomes(passed=mypy_file_checks, failed=mypy_status_check)E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}E Omitting 4 identical items, use -vv to showE Differing items:E {'passed': 2} != {'passed': 1}E {'failed': 0} != {'failed': 1}E Use -v to get more diff/home/tkloczko/rpmbuild/BUILD/pytest-mypy-0.9.1/tests/test_pytest_mypy.py:310: AssertionError--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------running: /usr/bin/python3 -mpytest --basetemp=/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect1/runpytest-0 --mypy -n auto /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect1/good.py in: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect1============================= test session starts ==============================platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0rootdir: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect1plugins: mypy-0.9.1, forked-1.4.0, xdist-2.5.0gw0 I / gw1 I / gw2 I / gw3 I / gw4 I / gw5 I / gw6 I / gw7 I / gw8 I / gw9 I / gw10 I / gw11 I / gw12 I / gw13 I / gw14 I / gw15 I / gw16 I / gw17 I / gw18 I / gw19 I / gw20 I / gw21 I / gw22 I / gw23 I / gw24 I / gw25 I / gw26 I / gw27 I / gw28 I / gw29 I / gw30 I / gw31 I / gw32 I / gw33 I / gw34 I / gw35 I / gw36 I / gw37 I / gw38 I / gw39 I / gw40 I / gw41 I / gw42 I / gw43 I / gw44 I / gw45 I / gw46 I / gw47 Igw0 [2] / gw1 [2] / gw2 [2] / gw3 [2] / gw4 [2] / gw5 [2] / gw6 [2] / gw7 [2] / gw8 [2] / gw9 [2] / gw10 [2] / gw11 [2] / gw12 [2] / gw13 [2] / gw14 [2] / gw15 [2] / gw16 [2] / gw17 [2] / gw18 [2] / gw19 [2] / gw20 [2] / gw21 [2] / gw22 [2] / gw23 [2] / gw24 [2] / gw25 [2] / gw26 [2] / gw27 [2] / gw28 [2] / gw29 [2] / gw30 [2] / gw31 [2] / gw32 [2] / gw33 [2] / gw34 [2] / gw35 [2] / gw36 [2] / gw37 [2] / gw38 [2] / gw39 [2] / gw40 [2] / gw41 [2] / gw42 [2] / gw43 [2] / gw44 [2] / gw45 [2] / gw46 [2] / gw47 [2].. [100%]===================================== mypy =====================================Success: no issues found in 1 source file============================== 2 passed in 7.64s ===============================____________________________________________________________________ test_mypy_indirect[False-__init__] ____________________________________________________________________testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect2')>, xdist_args = [], module_name = '__init__' @pytest.mark.parametrize( "module_name", [ pytest.param( "__init__", marks=pytest.mark.xfail( (3, 10) <= PYTEST_VERSION < (6, 2), raises=AssertionError, reason="https://github.com/pytest-dev/pytest/issues/8016", ), ), "good", ], ) def test_mypy_indirect(testdir, xdist_args, module_name): """Verify that uncollected files checked by mypy cause a failure.""" testdir.makepyfile( bad=""" def pyfunc(x: int) -> str: return x * 2 """, ) pyfile = testdir.makepyfile( **{ module_name: """ import bad """, }, ) result = testdir.runpytest_subprocess("--mypy", *xdist_args, str(pyfile)) mypy_file_checks = 1 mypy_status_check = 1
> result.assert_outcomes(passed=mypy_file_checks, failed=mypy_status_check)E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}E Omitting 4 identical items, use -vv to showE Differing items:E {'passed': 2} != {'passed': 1}E {'failed': 0} != {'failed': 1}E Use -v to get more diff/home/tkloczko/rpmbuild/BUILD/pytest-mypy-0.9.1/tests/test_pytest_mypy.py:310: AssertionError--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------running: /usr/bin/python3 -mpytest --basetemp=/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect2/runpytest-0 --mypy /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect2/__init__.py in: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect2============================= test session starts ==============================platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0rootdir: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect2plugins: mypy-0.9.1, forked-1.4.0, xdist-2.5.0collected 2 items__init__.py .. [100%]===================================== mypy =====================================Success: no issues found in 1 source file============================== 2 passed in 4.01s ===============================______________________________________________________________________ test_mypy_indirect[False-good] ______________________________________________________________________testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect3')>, xdist_args = [], module_name = 'good' @pytest.mark.parametrize( "module_name", [ pytest.param( "__init__", marks=pytest.mark.xfail( (3, 10) <= PYTEST_VERSION < (6, 2), raises=AssertionError, reason="https://github.com/pytest-dev/pytest/issues/8016", ), ), "good", ], ) def test_mypy_indirect(testdir, xdist_args, module_name): """Verify that uncollected files checked by mypy cause a failure.""" testdir.makepyfile( bad=""" def pyfunc(x: int) -> str: return x * 2 """, ) pyfile = testdir.makepyfile( **{ module_name: """ import bad """, }, ) result = testdir.runpytest_subprocess("--mypy", *xdist_args, str(pyfile)) mypy_file_checks = 1 mypy_status_check = 1
> result.assert_outcomes(passed=mypy_file_checks, failed=mypy_status_check)E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}E Omitting 4 identical items, use -vv to showE Differing items:E {'passed': 2} != {'passed': 1}E {'failed': 0} != {'failed': 1}E Use -v to get more diff/home/tkloczko/rpmbuild/BUILD/pytest-mypy-0.9.1/tests/test_pytest_mypy.py:310: AssertionError--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------running: /usr/bin/python3 -mpytest --basetemp=/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect3/runpytest-0 --mypy /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect3/good.py in: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect3============================= test session starts ==============================platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0rootdir: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect3plugins: mypy-0.9.1, forked-1.4.0, xdist-2.5.0collected 2 itemsgood.py .. [100%]===================================== mypy =====================================Success: no issues found in 1 source file============================== 2 passed in 4.01s ===============================____________________________________________________________________ test_mypy_indirect[None-__init__] _____________________________________________________________________testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect4')>, xdist_args = ['-p', 'no:xdist'], module_name = '__init__' @pytest.mark.parametrize( "module_name", [ pytest.param( "__init__", marks=pytest.mark.xfail( (3, 10) <= PYTEST_VERSION < (6, 2), raises=AssertionError, reason="https://github.com/pytest-dev/pytest/issues/8016", ), ), "good", ], ) def test_mypy_indirect(testdir, xdist_args, module_name): """Verify that uncollected files checked by mypy cause a failure.""" testdir.makepyfile( bad=""" def pyfunc(x: int) -> str: return x * 2 """, ) pyfile = testdir.makepyfile( **{ module_name: """ import bad """, }, ) result = testdir.runpytest_subprocess("--mypy", *xdist_args, str(pyfile)) mypy_file_checks = 1 mypy_status_check = 1
> result.assert_outcomes(passed=mypy_file_checks, failed=mypy_status_check)E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}E Omitting 4 identical items, use -vv to showE Differing items:E {'passed': 2} != {'passed': 1}E {'failed': 0} != {'failed': 1}E Use -v to get more diff/home/tkloczko/rpmbuild/BUILD/pytest-mypy-0.9.1/tests/test_pytest_mypy.py:310: AssertionError--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------running: /usr/bin/python3 -mpytest --basetemp=/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect4/runpytest-0 --mypy -p no:xdist /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect4/__init__.py in: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect4============================= test session starts ==============================platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0rootdir: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect4plugins: mypy-0.9.1, forked-1.4.0, xdist-2.5.0collected 2 items__init__.py .. [100%]===================================== mypy =====================================Success: no issues found in 1 source file============================== 2 passed in 4.02s ===============================______________________________________________________________________ test_mypy_indirect[None-good] _______________________________________________________________________testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect5')>, xdist_args = ['-p', 'no:xdist'], module_name = 'good' @pytest.mark.parametrize( "module_name", [ pytest.param( "__init__", marks=pytest.mark.xfail( (3, 10) <= PYTEST_VERSION < (6, 2), raises=AssertionError, reason="https://github.com/pytest-dev/pytest/issues/8016", ), ), "good", ], ) def test_mypy_indirect(testdir, xdist_args, module_name): """Verify that uncollected files checked by mypy cause a failure.""" testdir.makepyfile( bad=""" def pyfunc(x: int) -> str: return x * 2 """, ) pyfile = testdir.makepyfile( **{ module_name: """ import bad """, }, ) result = testdir.runpytest_subprocess("--mypy", *xdist_args, str(pyfile)) mypy_file_checks = 1 mypy_status_check = 1
> result.assert_outcomes(passed=mypy_file_checks, failed=mypy_status_check)E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}E Omitting 4 identical items, use -vv to showE Differing items:E {'passed': 2} != {'passed': 1}E {'failed': 0} != {'failed': 1}E Use -v to get more diff/home/tkloczko/rpmbuild/BUILD/pytest-mypy-0.9.1/tests/test_pytest_mypy.py:310: AssertionError--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------running: /usr/bin/python3 -mpytest --basetemp=/tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect5/runpytest-0 --mypy -p no:xdist /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect5/good.py in: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect5============================= test session starts ==============================platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0rootdir: /tmp/pytest-of-tkloczko/pytest-1000/test_mypy_indirect5plugins: mypy-0.9.1, forked-1.4.0, xdist-2.5.0collected 2 itemsgood.py .. [100%]===================================== mypy =====================================Success: no issues found in 1 source file============================== 2 passed in 4.01s ======================================================================================================== short test summary info ==========================================================================FAILED tests/test_pytest_mypy.py::test_mypy_indirect[True-__init__] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}FAILED tests/test_pytest_mypy.py::test_mypy_indirect[True-good] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}FAILED tests/test_pytest_mypy.py::test_mypy_indirect[False-__init__] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}FAILED tests/test_pytest_mypy.py::test_mypy_indirect[False-good] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}FAILED tests/test_pytest_mypy.py::test_mypy_indirect[None-__init__] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}FAILED tests/test_pytest_mypy.py::test_mypy_indirect[None-good] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}================================================================= 6 failed, 47 passed in 334.51s (0:05:34) =================================================================
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 modulesHere is pytest output:
Here is list of installed modules in build env
The text was updated successfully, but these errors were encountered: