pytest
pytest copied to clipboard
Error collecting test session
==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
suite3_env/lib/python3.10/site-packages/_pytest/runner.py:341: in from_call
result: Optional[TResult] = func()
suite3_env/lib/python3.10/site-packages/_pytest/runner.py:372: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
suite3_env/lib/python3.10/site-packages/_pytest/main.py:743: in collect
for x in self._collectfile(path):
suite3_env/lib/python3.10/site-packages/_pytest/main.py:577: in _collectfile
assert (
E AssertionError: PosixPath('/<path>/<to>/<file>/<filename>.png') is not a file (isdir=False, exists=False, islink=False)
- generated xml file: <filepath_removed_from_error_printout>
- generated html file: <filepath_removed_from_error_printout>
=========================== short test summary info ============================
ERROR - AssertionError: PosixPath('/<path>/<to>/<file>/<filename>.png') is not a file (isdir=False, exists=False, islink=False)
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 3.88s ===============================
Bug description
Occasionally, I am getting the above error which leads to no tests collected. I am running a group of test suites on a Jenkins server. The specific file that is not being recognized as a file is a screenshot. I have observed the issue 4 times in the past month. Each time I have seen the error it has been due one of these screenshots. The other test suites collect tests and execute without issue.
Requirements.txt
pipenv==2022.7.4 async-generator==1.10 certifi==2023.5.7 cffi==1.15.1 cryptography==41.0.1 et-xmlfile==1.1.0 exceptiongroup==1.1.1 h11==0.14.0 idna==3.4 Jinja2==3.0.0 MarkupSafe==2.1.3 openpyxl==3.1.2 outcome==1.2.0 Pillow==9.5.0 pycparser==2.21 pydantic==1.10.9 pyOpenSSL==23.2.0 pyperclip==1.8.2 PySocks==1.7.1 pytest==7.4.0 pytest-html==3.2.0 PyYAML==6.0 requests==2.31.0 selenium==4.3.0 sniffio==1.3.0 sortedcontainers==2.4.0 trio==0.22.0 trio-websocket==0.10.3 typing_extensions==4.6.3 unishark==0.3.2 urllib3==1.26.16 urllib3-secure-extra==0.1.0 wsproto==1.2.0
Pytest and OS versions
pytest==7.4.0 OS == Amazon Linux 2
This is not much to go on, you will need to provide us with some way to reproduce the issue.
This issue is stale because it has been open for 14 days with no activity.
Stale for a long time and no-follow up, just helping the bot here a bit and closing manually.