Closed etragas-fathom closed 6 years ago
I think the problem is the way __add__
is implemented. This happens if you get more than one failure?
If you set 3 tests that fail and 2 workers it always fails.
tst.py:
import pytest
def test_tst():
assert False
def test_second():
assert False
def test_third():
assert False
HUAWEI_P10-796cab753f8233:pytest-parallel etragas$ python3 -m pytest --workers 2 ../tst.py
====================================================================== test session starts ======================================================================
platform darwin -- Python 3.6.6, pytest-3.8.1, py-1.6.0, pluggy-0.7.1
rootdir: /Users/etragas/diseaseTools, inifile: pytest.ini
plugins: parallel-0.0.6, xdist-1.23.2, profiling-1.3.0, mock-1.10.0, forked-0.2, cov-2.6.0
collected 3 items
pytest-parallel: 2 workers (processes), 1 test per worker (thread)
FFException in thread Thread-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/Users/etragas/diseaseTools/pytest-parallel/pytest_parallel/__init__.py", line 80, in run
run_test(self.session, item, None)
File "/Users/etragas/diseaseTools/pytest-parallel/pytest_parallel/__init__.py", line 50, in run_test
item.ihook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/hooks.py", line 258, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/manager.py", line 67, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/manager.py", line 61, in <lambda>
firstresult=hook.spec_opts.get('firstresult'),
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
return outcome.get_result()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
raise ex[1].with_traceback(ex[2])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
res = hook_impl.function(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/_pytest/runner.py", line 66, in pytest_runtest_protocol
runtestprotocol(item, nextitem=nextitem)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/_pytest/runner.py", line 81, in runtestprotocol
reports.append(call_and_report(item, "call", log))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/_pytest/runner.py", line 165, in call_and_report
hook.pytest_runtest_logreport(report=report)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/hooks.py", line 258, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/manager.py", line 67, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/manager.py", line 61, in <lambda>
firstresult=hook.spec_opts.get('firstresult'),
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
return outcome.get_result()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
raise ex[1].with_traceback(ex[2])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
res = hook_impl.function(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/_pytest/main.py", line 402, in pytest_runtest_logreport
self.testsfailed += 1
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'int'
Still debugging in more detail but throwing this up in case you see an obvious fix!