kevlened / pytest-parallel

A pytest plugin for parallel and concurrent testing
https://github.com/browsertron/pytest-parallel/issues/104#issuecomment-1293941066
MIT License
313 stars 60 forks source link

TypeError when use gevent and pytest-parallel #37

Closed Alipipe closed 4 years ago

Alipipe commented 5 years ago

Traceback (most recent call last): File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/local/lib/python3.7/site-packages/pytest_parallel/init.py", line 81, in run run_test(self.session, item, None) File "/usr/local/lib/python3.7/site-packages/pytest_parallel/init.py", line 51, in run_test item.ihook.pytest_runtest_protocol(item=item, nextitem=nextitem) File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in call return self._hookexec(self, self.get_hookimpls(), kwargs) File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec return self._inner_hookexec(hook, methods, kwargs) File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 81, in firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall return outcome.get_result() File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result raise ex[1].with_traceback(ex[2]) File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall res = hook_impl.function(args) File "/usr/local/lib/python3.7/site-packages/_pytest/runner.py", line 72, in pytest_runtest_protocol runtestprotocol(item, nextitem=nextitem) File "/usr/local/lib/python3.7/site-packages/_pytest/runner.py", line 88, in runtestprotocol reports.append(call_and_report(item, "teardown", log, nextitem=nextitem)) File "/usr/local/lib/python3.7/site-packages/_pytest/runner.py", line 171, in call_and_report hook.pytest_runtest_logreport(report=report) File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in call return self._hookexec(self, self.get_hookimpls(), kwargs) File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec return self._inner_hookexec(hook, methods, kwargs) File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 81, in firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall return outcome.get_result() File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result raise ex[1].with_traceback(ex[2]) File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall res = hook_impl.function(args) File "/usr/local/lib/python3.7/site-packages/_pytest/main.py", line 434, in pytest_runtest_logreport if maxfail and self.testsfailed >= maxfail: TypeError: '>=' not supported between instances of 'SafeNumber' and 'int'

Alipipe commented 5 years ago

SafeNumber is missing ge and le methods (and also ne if Python 2 is supported):

https://github.com/browsertron/pytest-parallel/blob/33ecf89274cdbbb78fe849cec7c6cde0f1a50d0d/pytest_parallel/__init__.py#L163-L206

i got this answar from pytest

blueyed commented 4 years ago

Do you like to create a PR?