Open aditya123456 opened 4 years ago
FWIW:
About a year after this issue was reported, I'm still getting this error with all latest packages:
$ python3 -m pip freeze | grep pytest
pytest==6.2.4
pytest-aiohttp==0.3.0
pytest-asyncio==0.15.1
pytest-email==0.3
pytest-forked==1.3.0
pytest-html==3.1.1
pytest-metadata==1.11.0
pytest-parallel==0.1.0
pytest-runner==5.3.0
pytest-sugar==0.9.4
pytest-timeout==1.4.2
pytest-xdist==2.2.1
I am getting a different error - AttributeError: Can't pickle local object 'ArgumentParser.init.
plugins: bdd-4.0.2, forked-1.3.0, html-3.1.1, html-reporter-0.2.6, metadata-1.11.0, parallel-0.1.0, xdist-2.3.0
collected 2 items
pytest-parallel: 1 worker (process), 2 tests per worker (threads)
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File ".virtualenvs\python-pytest-mr85e9qf\lib\site-packages_pytest\main.py", line 269, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File ".virtualenvs\python-pytest-mr85e9qf\lib\site-packages_pytest\main.py", line 323, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File ".virtualenvs\python-pytest-mr85e9qf\lib\site-packages\pluggy\hooks.py", line 286, in call
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File ".virtualenvs\python-pytest-mr85e9qf\lib\site-packages\pluggy\manager.py", line 93,
in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File ".virtualenvs\python-pytest-mr85e9qf\lib\site-packages\pluggy\manager.py", line 87,
in
=================================================== no tests ran in 0.33s ====================================================
Traceback (most recent call last):
File "
pipenv graph
pytest-bdd==4.0.2
$ python -m pip freeze | grep pytest allure-pytest==2.11.1 pylint-pytest==1.1.2 pytest==7.1.3 pytest-parallel==0.1.1 pytest-pycharm==0.7.0
============================= test session starts ==============================
platform linux -- Python 3.9.15, pytest-7.1.3, pluggy-1.0.0 -- /usr/local/bin/python
cachedir: .pytest_cache
rootdir: /builds/ocean/enablers/ocean-testbot/cdr/tests, configfile: pytest.ini
plugins: allure-pytest-2.11.1, pycharm-0.7.0, parallel-0.1.1
collecting ... collected 9 items
pytest-parallel: 2 workers (processes), 5 tests per worker (threads)
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/allure_pytest/listener.py", line 78, in pytest_runtest_protocol
INTERNALERROR> self.allure_logger.schedule_test(uuid, test_result)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/allure_commons/reporter.py", line 114, in schedule_test
INTERNALERROR> self._items[uuid] = test_case
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/allure_commons/reporter.py", line 30, in setitem
INTERNALERROR> self.thread_context.setitem(key, value)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/allure_commons/reporter.py", line 21, in thread_context
INTERNALERROR> uuid, last_item = next(reversed(self._thread_context[self._init_thread].items()))
INTERNALERROR> StopIteration
INTERNALERROR>
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pytest_parallel/init.py", line 93, in run
INTERNALERROR> run_test(self.session, item, None)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pytest_parallel/init.py", line 54, in run_test
INTERNALERROR> item.ihook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 34, in _multicall
INTERNALERROR> next(gen) # first yield
INTERNALERROR> RuntimeError: generator raised StopIteration
INTERNALERROR>
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 268, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 322, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python3.9/site-packages/pytest_parallel/init.py", line 334, in pytest_runtestloop
INTERNALERROR> six.raise_from(exc, err[1])
INTERNALERROR> File "
I got same error as @rafalf , the only difference is line number Python: 3.7.15 pytest 6.2.5 pytest-parallel 0.1.1 os: CentOS Linux release 7.9.2009 (Core). It's a virtual machine.
Before using pytest-parallel 0.1.1, I used v0.0.10, but no testcase get executed. Meanwhile I have an old environment with same os version and same python,pytest, pytest-parallel(0.0.10), it works fine(it's a physical server).
error with pytest-parallel 0.1.1
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/allure_pytest/listener.py", line 78, in pytest_runtest_protocol
INTERNALERROR> self.allure_logger.schedule_test(uuid, test_result)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/allure_commons/reporter.py", line 114, in schedule_test
INTERNALERROR> self._items[uuid] = test_case
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/allure_commons/reporter.py", line 30, in setitem
INTERNALERROR> self.thread_context.setitem(key, value)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/allure_commons/reporter.py", line 21, in thread_context
INTERNALERROR> uuid, last_item = next(reversed(self._thread_context[self._init_thread].items()))
INTERNALERROR> StopIteration
INTERNALERROR>
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pytest_parallel/init.py", line 93, in run
INTERNALERROR> run_test(self.session, item, None)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pytest_parallel/init.py", line 54, in run_test
INTERNALERROR> item.ihook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_callers.py", line 34, in _multicall
INTERNALERROR> next(gen) # first yield
INTERNALERROR> RuntimeError: generator raised StopIteration
INTERNALERROR>
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/app/anaconda3/envs/automation/lib/python3.7/site-packages/pytest_parallel/init.py", line 334, in pytest_runtestloop
INTERNALERROR> six.raise_from(exc, err[1])
INTERNALERROR> File "
i got the same question
how to sovle this problem?
========================================================================================================= test session starts ==========================================================================================================
platform darwin -- Python 3.10.9, pytest-7.2.2, pluggy-1.0.0 -- /Users//PycharmProjects/my_project/cube_test/.venv/bin/python
cachedir: .pytest_cache
metadata: {'Python': '3.10.9', 'Platform': 'macOS-12.3.1-x86_64-i386-64bit', 'Packages': {'pytest': '7.2.2', 'pluggy': '1.0.0'}, 'Plugins': {'html': '3.2.0', 'parallel': '0.1.1', 'allure-pytest': '2.13.5', 'ordering': '0.6', 'Faker': '19.10.0', 'xdist': '3.5.0', 'metadata': '2.0.4'}, 'JAVA_HOME': '/Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home'}
rootdir: /Users//PycharmProjects/my_project/cube_test, configfile: pytest.ini
plugins: html-3.2.0, parallel-0.1.1, allure-pytest-2.13.5, ordering-0.6, Faker-19.10.0, xdist-3.5.0, metadata-2.0.4
collected 18 items
pytest-parallel: 1 worker (process), 4 tests per worker (threads)
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/allure_pytest/listener.py", line 88, in pytest_runtest_protocol
INTERNALERROR> self.allure_logger.schedule_test(uuid, test_result)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/allure_commons/reporter.py", line 114, in schedule_test
INTERNALERROR> self._items[uuid] = test_case
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/allure_commons/reporter.py", line 30, in setitem
INTERNALERROR> self.thread_context.setitem(key, value)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/allure_commons/reporter.py", line 21, in thread_context
INTERNALERROR> uuid, last_item = next(reversed(self._thread_context[self._init_thread].items()))
INTERNALERROR> StopIteration
INTERNALERROR>
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pytest_parallel/init.py", line 93, in run
INTERNALERROR> run_test(self.session, item, None)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pytest_parallel/init.py", line 54, in run_test
INTERNALERROR> item.ihook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 34, in _multicall
INTERNALERROR> next(gen) # first yield
INTERNALERROR> RuntimeError: generator raised StopIteration
INTERNALERROR>
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/_pytest/main.py", line 270, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users//PycharmProjects/my_project/cube_test/.venv/lib/python3.10/site-packages/pytest_parallel/init.py", line 334, in pytest_runtestloop
INTERNALERROR> six.raise_from(exc, err[1])
INTERNALERROR> File "
platform linux -- Python 3.7.5, pytest-5.3.4, py-1.8.1, pluggy-0.13.1 I suddenly started getting below error in my git lab CI pipeline .
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pytest_parallel/init.py", line 86, in run INTERNALERROR> run_test(self.session, item, None) INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pytest_parallel/init.py", line 51, in run_test INTERNALERROR> item.ihook.pytest_runtest_protocol(item=item, nextitem=nextitem) INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in call INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs) INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs) INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/manager.py", line 87, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/callers.py", line 182, in _multicall
INTERNALERROR> next(gen) # first yield
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pytest_reportportal/listener.py", line 36, in pytest_runtest_protocol
INTERNALERROR> item_id = self.PyTestService.start_pytest_item(item)
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pytest_reportportal/service.py", line 232, in start_pytest_item
INTERNALERROR> self.parent_item_id = self._hier_parts[part]["item_id"]
INTERNALERROR> KeyError: 'item_id'
INTERNALERROR>
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/_pytest/main.py", line 197, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/_pytest/main.py", line 247, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in call
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/manager.py", line 87, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/builds/core-tech/tools/qa/cstudio_automation/venv/lib/python3.7/site-packages/pytest_parallel/init.py", line 397, in pytest_runtestloop
INTERNALERROR> six.raise_from(exc, err[1])
INTERNALERROR> File "", line 3, in raise_from
INTERNALERROR> RuntimeError: pytest-parallel got 20 errors, raising the first from Thread-7.