Skip to content

Support pytest 4 #411

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

Closed
FRidh opened this issue Feb 14, 2019 · 2 comments · Fixed by #497
Closed

Support pytest 4 #411

FRidh opened this issue Feb 14, 2019 · 2 comments · Fixed by #497

Comments

@FRidh
Copy link

FRidh commented Feb 14, 2019

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()
@hroncok
Copy link
Contributor

hroncok commented Mar 28, 2019

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

@hroncok
Copy link
Contributor

hroncok commented Mar 28, 2019

I'll try to submit a PR.

hroncok added a commit to hroncok/html5lib-python that referenced this issue Mar 28, 2019
@gsnedders gsnedders changed the title ERROR collecting html5lib/tests/test_stream.py Support pytest 4 May 24, 2020
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

Successfully merging a pull request may close this issue.

2 participants