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

pytest-check causes pytest-xdist testing to fail #146

Closed
mtelka opened this issue Nov 13, 2023 · 1 comment
Closed

pytest-check causes pytest-xdist testing to fail #146

mtelka opened this issue Nov 13, 2023 · 1 comment

Comments

@mtelka
Copy link

mtelka commented Nov 13, 2023

I tried to run tests for pytest-xdist with pytest-check installed and disabled using -p no:check set in PYTEST_ADDOPTS environment variable. I noticed that with this setup the pytest-xdist testing fails:

_________________________ test_without_terminal_plugin _________________________

pytester = <Pytester PosixPath('/tmp/pytest-of-marcel/pytest-126/test_without_terminal_plugin0')>
request = <FixtureRequest for <Function test_without_terminal_plugin>>

    def test_without_terminal_plugin(pytester, request) -> None:
        """
        No output when terminal plugin is disabled
        """
        pytester.makepyfile(
            """
            def test_1():
                pass
        """
        )
        result = pytester.runpytest("-p", "no:terminal", "-n2")
        assert result.stdout.str() == ""
>       assert result.stderr.str() == ""
E       assert "INTERNALERRO...ibute 'color'" == ''
E         + INTERNALERROR> Traceback (most recent call last):
E         + INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/_pytest/main.py", line 267, in wrap_session
E         + INTERNALERROR>     config._do_configure()
E         + INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/_pytest/config/__init__.py", line 1053, in _do_configure
E         + INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
E         + INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/pluggy/_hooks.py", line 514, in call_historic
E         + INTERNALERROR>     res = self._hookexec(self.name, self._hookimpls, kwargs, False)...
E
E         ...Full output truncated (9 lines hidden), use '-vv' to show

$(BUILD_DIR)/testing/acceptance_test.py:1156: AssertionError
----------------------------- Captured stderr call -----------------------------
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/_pytest/main.py", line 267, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/_pytest/config/__init__.py", line 1053, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/pluggy/_hooks.py", line 514, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self._hookimpls, kwargs, False)
INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/pluggy/_callers.py", line 113, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.9/vendor-packages/pytest_check/plugin.py", line 47, in pytest_configure
INTERNALERROR>     color = config.option.color
INTERNALERROR> AttributeError: 'Namespace' object has no attribute 'color'

Version info:

  • pytest-check 2.2.2
  • pytest-xdist 3.4.0
  • pytest 7.4.3
  • pluggy 1.3.0
  • Python 3.9.16
@okken
Copy link
Owner

okken commented Nov 17, 2023

looks like a dup of pytest-dev/pluggy#457
There's nothing pytest-check can do about this

@okken okken closed this as completed Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants