Skip to content

Support pytest 4 #411

Closed
Closed

Description

@FRidh

I suppose the test suite is not pytest 4.2 compatible.

============================= test session starts ==============================
platform linux -- Python 3.7.2, pytest-4.2.1, py-1.7.0, pluggy-0.8.1
rootdir: /build/html5lib-1.0.1, inifile: pytest.ini
plugins: expect-1.1.0
collected 31264 items / 1 errors / 31263 selected

==================================== ERRORS ====================================
________________ ERROR collecting html5lib/tests/test_stream.py ________________
/nix/store/mljhw8f6ng9ny9ahx68m9fj6bq0ghbqv-python3.7-pluggy-0.8.1/lib/python3.7/site-packages/pluggy/hooks.py:284: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
/nix/store/mljhw8f6ng9ny9ahx68m9fj6bq0ghbqv-python3.7-pluggy-0.8.1/lib/python3.7/site-packages/pluggy/manager.py:68: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/nix/store/mljhw8f6ng9ny9ahx68m9fj6bq0ghbqv-python3.7-pluggy-0.8.1/lib/python3.7/site-packages/pluggy/manager.py:62: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
/nix/store/pf8c7km0691nci67allvq2ggsgvr8asl-python3.7-pytest-4.2.1/lib/python3.7/site-packages/_pytest/python.py:226: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
/nix/store/pf8c7km0691nci67allvq2ggsgvr8asl-python3.7-pytest-4.2.1/lib/python3.7/site-packages/_pytest/python.py:403: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
/nix/store/mljhw8f6ng9ny9ahx68m9fj6bq0ghbqv-python3.7-pluggy-0.8.1/lib/python3.7/site-packages/pluggy/hooks.py:284: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
/nix/store/mljhw8f6ng9ny9ahx68m9fj6bq0ghbqv-python3.7-pluggy-0.8.1/lib/python3.7/site-packages/pluggy/manager.py:68: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/nix/store/mljhw8f6ng9ny9ahx68m9fj6bq0ghbqv-python3.7-pluggy-0.8.1/lib/python3.7/site-packages/pluggy/manager.py:62: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
/nix/store/pf8c7km0691nci67allvq2ggsgvr8asl-python3.7-pytest-4.2.1/lib/python3.7/site-packages/_pytest/python.py:133: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/nix/store/pf8c7km0691nci67allvq2ggsgvr8asl-python3.7-pytest-4.2.1/lib/python3.7/site-packages/_pytest/python.py:987: in parametrize
    function_definition=self.definition,
/nix/store/pf8c7km0691nci67allvq2ggsgvr8asl-python3.7-pytest-4.2.1/lib/python3.7/site-packages/_pytest/mark/structures.py:114: in _for_parametrize
    if len(param.values) != len(argnames):
E   TypeError: object of type 'MarkDecorator' has no len()

Activity

  1. hroncok commented on Mar 28, 2019

    @hroncok
    Contributor

    Some deprecation warnings from before:

    =============================== warnings summary ===============================
    /usr/lib/python3.7/site-packages/_pytest/python.py:764
      /usr/lib/python3.7/site-packages/_pytest/python.py:764: RemovedInPytest4Warning: usage of Generator.Function is deprecated, please use pytest.Function instead
        function_class = self.Function
    html5lib/tests/test_encoding.py:98
      /builddir/build/BUILD/html5lib-1.0.1/html5lib/tests/test_encoding.py:98: RemovedInPytest4Warning: yield tests are deprecated, and scheduled to be removed in pytest 4.0
        def test_encoding():
    /usr/lib/python3.7/site-packages/_pytest/python.py:764
      /usr/lib/python3.7/site-packages/_pytest/python.py:764: RemovedInPytest4Warning: usage of Generator.Function is deprecated, please use pytest.Function instead
        function_class = self.Function
    html5lib/tests/test_sanitizer.py:62
      /builddir/build/BUILD/html5lib-1.0.1/html5lib/tests/test_sanitizer.py:62: RemovedInPytest4Warning: yield tests are deprecated, and scheduled to be removed in pytest 4.0
        def test_sanitizer():
    html5lib/tests/test_serializer.py:220
      /builddir/build/BUILD/html5lib-1.0.1/html5lib/tests/test_serializer.py:220: RemovedInPytest4Warning: yield tests are deprecated, and scheduled to be removed in pytest 4.0
        def test_serializer():
    html5lib/tests/test_stream.py:300
      html5lib/tests/test_stream.py:300: RemovedInPytest4Warning: Applying marks directly to parameters is deprecated, please use pytest.param(..., marks=...) instead.
      For more details, see: https://docs.pytest.org/en/latest/parametrize.html
        @pytest.mark.skipif(not supports_lone_surrogates, reason="doesn't support lone surrogates")
    html5lib/tests/test_treewalkers.py:81
      /builddir/build/BUILD/html5lib-1.0.1/html5lib/tests/test_treewalkers.py:81: RemovedInPytest4Warning: yield tests are deprecated, and scheduled to be removed in pytest 4.0
        def test_treewalker_six_mix():
    -- Docs: https://docs.pytest.org/en/latest/warnings.html
    
  2. hroncok commented on Mar 28, 2019

    @hroncok
    Contributor

    I'll try to submit a PR.

  3. added a commit that references this issue on Mar 28, 2019
  4. changed the title [-]ERROR collecting html5lib/tests/test_stream.py[/-] [+]Support pytest 4[/+] on May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions