pytest-sugar icon indicating copy to clipboard operation
pytest-sugar copied to clipboard

Incompatible with pytest-rerunfailures

Open pranav165 opened this issue 3 years ago • 1 comments

I use pytest-rerunfailures==9.1.1 to rerun in case a failure is encountered. While trying pytest-sugar along with pytest-reruns , following exception occurs

Command to execute - pytest -k api -n 10 --force-sugar --reruns 1 --alluredir=reports/allure-results --html=reports/results.html --self-contained-html --junitxml=reports/junit_report.xml

Test session starts (platform: win32, Python 3.9.6, pytest 6.1.1, pytest-sugar 0.9.4) cachedir: .pytest_cache metadata: {'Python': '3.9.6', 'Platform': 'Windows-10-10.0.19043-SP0', 'Packages': {'pytest': '6.1.1', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'allure-pytest': '2.8.36', 'cov': '2.12.1', 'forked': '1.3.0', 'html': '2.1.1', 'instafail': '0.4.2', 'metadata': '1.11.0', 'repeat': '0.8.0', 'rerunfailures': '10.1', 'sugar': '0.9.4', 'xdist': '2.1.0'}, 'channelplanner': '3.0.0-40', 'platform': '20.06.02', 'appscore': '5.1.26', 'plannerplus': '1.3.0-491', 'env': 'uat', 'E2E_GIT_BRANCH': 'e2e/fix_master'} rootdir: C:\e2e\networkplanner-e2e-test, configfile: pytest.ini plugins: allure-pytest-2.8.36, cov-2.12.1, forked-1.3.0, html-2.1.1, instafail-0.4.2, metadata-1.11.0, repeat-0.8.0, rerunfailures-10.1, sugar-0.9.4, xdist-2.1.0

[gw1] INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages_pytest\main.py", line 257, in wrap_session INTERNALERROR> session.exitstatus = doit(config, session) or 0 INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages_pytest\main.py", line 313, in _main INTERNALERROR> config.hook.pytest_runtestloop(session=session) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\hooks.py", line 286, in call INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\manager.py", line 93, in _hookexec INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\manager.py", line 84, in INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\callers.py", line 208, in _multicall INTERNALERROR> return outcome.get_result() INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\callers.py", line 80, in get_result INTERNALERROR> raise ex[1].with_traceback(ex[2]) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\callers.py", line 187, in _multicall INTERNALERROR> res = hook_impl.function(*args) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\xdist\dsession.py", line 112, in pytest_runtestloop INTERNALERROR> self.loop_once() INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\xdist\dsession.py", line 135, in loop_once INTERNALERROR> call(**kwargs) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\xdist\dsession.py", line 251, in worker_testreport INTERNALERROR> self.config.hook.pytest_runtest_logreport(report=rep) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\hooks.py", line 286, in call INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\manager.py", line 93, in _hookexec INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\manager.py", line 84, in INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\callers.py", line 208, in _multicall INTERNALERROR> return outcome.get_result() INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\callers.py", line 80, in get_result INTERNALERROR> raise ex[1].with_traceback(ex[2]) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pluggy\callers.py", line 187, in _multicall INTERNALERROR> res = hook_impl.function(*args) INTERNALERROR> File "C:\e2e\networkplanner-e2e-test\venv\lib\site-packages\pytest_sugar.py", line 492, in pytest_runtest_logreport INTERNALERROR> self._tw.write(word, **markup) INTERNALERROR> UnboundLocalError: local variable 'markup' referenced before assignment

pranav165 avatar Sep 07 '21 18:09 pranav165

Duplicate of #139

danielhoherd avatar Apr 04 '22 20:04 danielhoherd