Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pytest assert enrichment problem when running pytest with --workers option #215

Open
windiana42 opened this issue Aug 12, 2024 · 0 comments

Comments

@windiana42
Copy link
Member

This is a stack trace that illustrates the problem:

test_run_group_node.py:220: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../.pixi/envs/py312/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:492: in _call_reprcompare
    custom = util._reprcompare(ops[i], each_obj[i], each_obj[i + 1])
../.pixi/envs/py312/lib/python3.12/site-packages/_pytest/assertion/__init__.py:151: in callbinrepr
    hook_result = ihook.pytest_assertrepr_compare(
../.pixi/envs/py312/lib/python3.12/site-packages/pluggy/_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
../.pixi/envs/py312/lib/python3.12/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../.pixi/envs/py312/lib/python3.12/site-packages/_pytest/assertion/__init__.py:192: in pytest_assertrepr_compare
    return util.assertrepr_compare(config=config, op=op, left=left, right=right)
../.pixi/envs/py312/lib/python3.12/site-packages/_pytest/assertion/util.py:198: in assertrepr_compare
    highlighter = config.get_terminal_writer()._highlight
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_pytest.config.Config object at 0x101f60c50>

    def get_terminal_writer(self) -> TerminalWriter:
        terminalreporter: Optional[TerminalReporter] = self.pluginmanager.get_plugin(
            "terminalreporter"
        )
>       assert terminalreporter is not None
E       AssertionError

../.pixi/envs/py312/lib/python3.12/site-packages/_pytest/config/__init__.py:1145: AssertionError

An attempt to fix this issue had to be reverted since it prevented tests from actually running: d65de1b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant