Skip to content

pytest.ini: Add build to norecursedirs

It fixes _pytest.pathlib.ImportPathMismatchError when swh.graphql packaging has been performed.

11:21 $ make test
python3 -m pytest  .
================================================================================================================================== test session starts ==================================================================================================================================
platform linux -- Python 3.9.2, pytest-7.1.3, pluggy-1.0.0
rootdir: /home/anlambert/swh/swh-environment/swh-graphql, configfile: pytest.ini
plugins: redis-2.4.0, asyncio-0.19.0, subprocess-1.4.2, postgresql-3.1.3, forked-1.4.0, flask-1.2.0, anyio-3.6.1, xdist-2.5.0, cov-3.0.0, dash-2.6.1, requests-mock-1.9.3, django-test-migrations-1.2.0, django-4.5.2, mock-3.8.2, testinfra-7.0.0, hypothesis-6.56.2, swh.core-2.18.1, swh.journal-1.2.2.dev2+g1fa7742
asyncio: mode=strict
collected 0 items / 1 error                                                                                                                                                                                                                                                             

======================================================================================================================================== ERRORS =========================================================================================================================================
_____________________________________________________________________________________________________________________________ ERROR collecting test session _____________________________________________________________________________________________________________________________
../../../.virtualenvs/swh/lib/python3.9/site-packages/_pytest/config/__init__.py:607: in _importconftest
    mod = import_path(conftestpath, mode=importmode, root=rootpath)
../../../.virtualenvs/swh/lib/python3.9/site-packages/_pytest/pathlib.py:556: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('swh.graphql.tests.conftest', '/home/anlambert/swh/swh-environment/swh-graphql/swh/graphql/tests/conftest.py', PosixPath('/home/anlambert/swh/swh-environment/swh-graphql/build/lib/swh/graphql/tests/conftest.py'))
================================================================================================================================ short test summary info ================================================================================================================================
ERROR  - _pytest.pathlib.ImportPathMismatchError: ('swh.graphql.tests.conftest', '/home/anlambert/swh/swh-environment/swh-graphql/swh/graphql/tests/conftest.py', PosixPath('/home/anlambert/swh/swh-environment/swh-graphql/build/lib/swh/graphql/tests/conftest.py'))
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================================================================================================== 1 error in 0.23s ====================================================================================================================================

Merge request reports