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

2 tests fail #123

Closed
yurivict opened this issue Jun 23, 2023 · 1 comment
Closed

2 tests fail #123

yurivict opened this issue Jun 23, 2023 · 1 comment

Comments

@yurivict
Copy link

__________________________________________________________________________________________ ERROR at setup of test_multiple_wait[True] __________________________________________________________________________________________

self = <flaky.flaky_pytest_plugin.FlakyPlugin object at 0x8cfd165e0>, item = <Function test_multiple_wait[True]>

    def pytest_runtest_setup(self, item):
        """
        Pytest hook to modify the test before it's run.
    
        :param item:
            The test item.
        """
        if not self._has_flaky_attributes(item):
            if hasattr(item, 'iter_markers'):
                for marker in item.iter_markers(name='flaky'):
>                   self._make_test_flaky(item, *marker.args, **marker.kwargs)
E                   TypeError: _make_test_flaky() got an unexpected keyword argument 'reruns'

/usr/local/lib/python3.9/site-packages/flaky/flaky_pytest_plugin.py:244: TypeError
_____________________________________________________________________________________ ERROR at setup of test_raise_exception_check_output ______________________________________________________________________________________

self = <flaky.flaky_pytest_plugin.FlakyPlugin object at 0x8cfd165e0>, item = <Function test_raise_exception_check_output>

    def pytest_runtest_setup(self, item):
        """
        Pytest hook to modify the test before it's run.
    
        :param item:
            The test item.
        """
        if not self._has_flaky_attributes(item):
            if hasattr(item, 'iter_markers'):
                for marker in item.iter_markers(name='flaky'):
>                   self._make_test_flaky(item, *marker.args, **marker.kwargs)
E                   TypeError: _make_test_flaky() got an unexpected keyword argument 'reruns'

/usr/local/lib/python3.9/site-packages/flaky/flaky_pytest_plugin.py:244: TypeError
_________________________________________________________________________________________ ERROR at setup of test_multiple_wait[False] __________________________________________________________________________________________

self = <flaky.flaky_pytest_plugin.FlakyPlugin object at 0x8cfd165e0>, item = <Function test_multiple_wait[False]>

    def pytest_runtest_setup(self, item):
        """
        Pytest hook to modify the test before it's run.
    
        :param item:
            The test item.
        """
        if not self._has_flaky_attributes(item):
            if hasattr(item, 'iter_markers'):
                for marker in item.iter_markers(name='flaky'):
>                   self._make_test_flaky(item, *marker.args, **marker.kwargs)
E                   TypeError: _make_test_flaky() got an unexpected keyword argument 'reruns'

/usr/local/lib/python3.9/site-packages/flaky/flaky_pytest_plugin.py:244: TypeError
=========================================================================================================== FAILURES ===========================================================================================================
______________________________________________________________________________________________ test_documentation[docs/index.rst] ______________________________________________________________________________________________

testdir = <Testdir local('/tmp/pytest-of-yuri/pytest-12/test_documentation0')>, rst_file = 'docs/index.rst'

    @pytest.mark.parametrize("rst_file", ("docs/index.rst", "README.rst"))
    def test_documentation(testdir, rst_file):
        imports = "\n".join(
            [
                "import asyncio",
                "import os",
                "import sys",
                "",
                "import pytest",
                "import pytest_subprocess",
                "import subprocess",
            ]
        )
    
        setup_fixture = (
            "\n\n"
            "@pytest.fixture(autouse=True)\n"
            "def setup():\n"
            "    os.chdir(os.path.dirname(__file__))\n\n"
        )
    
        event_loop_fixture = (
            "\n\n"
            "@pytest.fixture(autouse=True)\n"
            "def event_loop(request):\n"
            "    policy = asyncio.get_event_loop_policy()\n"
            '    if sys.platform == "win32":\n'
            "        loop = asyncio.ProactorEventLoop()\n"
            "    else:\n"
            "        loop = policy.get_event_loop()\n"
            "    yield loop\n"
            "    loop.close()\n"
        )
    
        code_blocks = "\n".join(get_code_blocks(ROOT_DIR / rst_file))
        testdir.makepyfile(
            imports + setup_fixture + event_loop_fixture + "\n" + code_blocks
        )
    
>       result = testdir.inline_run()

/usr/ports/devel/py-pytest-subprocess/work-py39/pytest-subprocess-1.5.0/tests/test_examples.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.9/site-packages/_pytest/legacypath.py:173: in inline_run
    return self._pytester.inline_run(
/usr/local/lib/python3.9/site-packages/_pytest/pytester.py:1135: in inline_run
    ret = main([str(x) for x in args], plugins=plugins)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:147: in main
    config = _prepareconfig(args, plugins)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:328: in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
/usr/local/lib/python3.9/site-packages/pluggy/_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/usr/local/lib/python3.9/site-packages/_pytest/helpconfig.py:103: in pytest_cmdline_parse
    config: Config = outcome.get_result()
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1067: in pytest_cmdline_parse
    self.parse(args)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1354: in parse
    self._preparse(args, addopts=addopts)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1237: in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
/usr/local/lib/python3.9/site-packages/pluggy/_manager.py:288: in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:488: in register
    ret: Optional[str] = super().register(plugin, name)
/usr/local/lib/python3.9/site-packages/pluggy/_manager.py:103: in register
    hookimpl_opts = self.parse_hookimpl_opts(plugin, name)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:459: in parse_hookimpl_opts
    return _get_legacy_hook_marks(
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:373: in _get_legacy_hook_marks
    warn_explicit_for(cast(FunctionType, method), message)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

method = <function pytest_load_initial_conftests at 0x8744c2820>
message = PytestDeprecationWarning('The hookimpl pytest_load_initial_conftests uses old-style configuration options (marks or at...igure the hooks.\n See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers')

    def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None:
        """
        Issue the warning :param:`message` for the definition of the given :param:`method`
    
        this helps to log warnigns for functions defined prior to finding an issue with them
        (like hook wrappers being marked in a legacy mechanism)
        """
        lineno = method.__code__.co_firstlineno
        filename = inspect.getfile(method)
        module = method.__module__
        mod_globals = method.__globals__
        try:
            warnings.warn_explicit(
                message,
                type(message),
                filename=filename,
                module=module,
                registry=mod_globals.setdefault("__warningregistry__", {}),
                lineno=lineno,
            )
        except Warning as w:
            # If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message.
>           raise type(w)(f"{w}\n at {filename}:{lineno}") from None
E           pytest.PytestDeprecationWarning: The hookimpl pytest_load_initial_conftests uses old-style configuration options (marks or attributes).
E           Please use the pytest.hookimpl(tryfirst=True) decorator instead
E            to configure the hooks.
E            See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers
E            at /usr/local/lib/python3.9/site-packages/pytest_cov/plugin.py:115

/usr/local/lib/python3.9/site-packages/_pytest/warning_types.py:170: PytestDeprecationWarning
----------------------------------------------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------------------------------------------
<string>:30: (ERROR/3) Unknown directive type "toctree".

.. toctree::
   :maxdepth: 2

   usage
   api
   history



<string>:42: (ERROR/3) Unknown interpreted text role "ref".
<string>:43: (ERROR/3) Unknown interpreted text role "ref".
<string>:44: (ERROR/3) Unknown interpreted text role "ref".
________________________________________________________________________________________________ test_documentation[README.rst] ________________________________________________________________________________________________

testdir = <Testdir local('/tmp/pytest-of-yuri/pytest-12/test_documentation1')>, rst_file = 'README.rst'

    @pytest.mark.parametrize("rst_file", ("docs/index.rst", "README.rst"))
    def test_documentation(testdir, rst_file):
        imports = "\n".join(
            [
                "import asyncio",
                "import os",
                "import sys",
                "",
                "import pytest",
                "import pytest_subprocess",
                "import subprocess",
            ]
        )
    
        setup_fixture = (
            "\n\n"
            "@pytest.fixture(autouse=True)\n"
            "def setup():\n"
            "    os.chdir(os.path.dirname(__file__))\n\n"
        )
    
        event_loop_fixture = (
            "\n\n"
            "@pytest.fixture(autouse=True)\n"
            "def event_loop(request):\n"
            "    policy = asyncio.get_event_loop_policy()\n"
            '    if sys.platform == "win32":\n'
            "        loop = asyncio.ProactorEventLoop()\n"
            "    else:\n"
            "        loop = policy.get_event_loop()\n"
            "    yield loop\n"
            "    loop.close()\n"
        )
    
        code_blocks = "\n".join(get_code_blocks(ROOT_DIR / rst_file))
        testdir.makepyfile(
            imports + setup_fixture + event_loop_fixture + "\n" + code_blocks
        )
    
>       result = testdir.inline_run()

/usr/ports/devel/py-pytest-subprocess/work-py39/pytest-subprocess-1.5.0/tests/test_examples.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.9/site-packages/_pytest/legacypath.py:173: in inline_run
    return self._pytester.inline_run(
/usr/local/lib/python3.9/site-packages/_pytest/pytester.py:1135: in inline_run
    ret = main([str(x) for x in args], plugins=plugins)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:147: in main
    config = _prepareconfig(args, plugins)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:328: in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
/usr/local/lib/python3.9/site-packages/pluggy/_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/usr/local/lib/python3.9/site-packages/_pytest/helpconfig.py:103: in pytest_cmdline_parse
    config: Config = outcome.get_result()
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1067: in pytest_cmdline_parse
    self.parse(args)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1354: in parse
    self._preparse(args, addopts=addopts)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1237: in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
/usr/local/lib/python3.9/site-packages/pluggy/_manager.py:288: in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:488: in register
    ret: Optional[str] = super().register(plugin, name)
/usr/local/lib/python3.9/site-packages/pluggy/_manager.py:103: in register
    hookimpl_opts = self.parse_hookimpl_opts(plugin, name)
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:459: in parse_hookimpl_opts
    return _get_legacy_hook_marks(
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:373: in _get_legacy_hook_marks
    warn_explicit_for(cast(FunctionType, method), message)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

method = <function pytest_load_initial_conftests at 0x8744c2820>
message = PytestDeprecationWarning('The hookimpl pytest_load_initial_conftests uses old-style configuration options (marks or at...igure the hooks.\n See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers')

    def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None:
        """
        Issue the warning :param:`message` for the definition of the given :param:`method`
    
        this helps to log warnigns for functions defined prior to finding an issue with them
        (like hook wrappers being marked in a legacy mechanism)
        """
        lineno = method.__code__.co_firstlineno
        filename = inspect.getfile(method)
        module = method.__module__
        mod_globals = method.__globals__
        try:
            warnings.warn_explicit(
                message,
                type(message),
                filename=filename,
                module=module,
                registry=mod_globals.setdefault("__warningregistry__", {}),
                lineno=lineno,
            )
        except Warning as w:
            # If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message.
>           raise type(w)(f"{w}\n at {filename}:{lineno}") from None
E           pytest.PytestDeprecationWarning: The hookimpl pytest_load_initial_conftests uses old-style configuration options (marks or attributes).
E           Please use the pytest.hookimpl(tryfirst=True) decorator instead
E            to configure the hooks.
E            See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers
E            at /usr/local/lib/python3.9/site-packages/pytest_cov/plugin.py:115

/usr/local/lib/python3.9/site-packages/_pytest/warning_types.py:170: PytestDeprecationWarning
=================================================================================================== short test summary info ====================================================================================================
SKIPPED [4] tests/test_asyncio.py:114: condition: sys.platform!="win32"
===================================================================================== 2 failed, 127 passed, 4 skipped, 3 errors in 12.56s ======================================================================================
*** Error code 1

Version: 1.5.0
Python-3.9
FreeBSD 13.2

@aklajnert
Copy link
Owner

aklajnert commented Aug 28, 2023

@yurivict, could you please check on master?

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