Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1687942 - python-chardet tests fail with pytest 4
Summary: python-chardet tests fail with pytest 4
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-chardet
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTEST4 PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-03-12 17:34 UTC by Miro Hrončok
Modified: 2019-03-12 17:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-12 17:53:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2019-03-12 17:34:35 UTC
With pytest 3:

=============================== warnings summary ===============================
test.py:66
  test.py:66: 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.parametrize ('file_name, encoding', gen_test_params())
  test.py:66: 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.parametrize ('file_name, encoding', gen_test_params())
  test.py:66: 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.parametrize ('file_name, encoding', gen_test_params())
  test.py:66: 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.parametrize ('file_name, encoding', gen_test_params())
-- Docs: https://docs.pytest.org/en/latest/warnings.html
============== 359 passed, 4 xfailed, 4 warnings in 47.63 seconds ==============

With pytest 4:

==================================== ERRORS ====================================
___________________________ ERROR collecting test.py ___________________________
/usr/lib/python2.7/site-packages/pluggy/hooks.py:284: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
/usr/lib/python2.7/site-packages/pluggy/manager.py:68: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python2.7/site-packages/pluggy/manager.py:62: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
/usr/lib/python2.7/site-packages/_pytest/python.py:226: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
/usr/lib/python2.7/site-packages/_pytest/python.py:403: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
/usr/lib/python2.7/site-packages/pluggy/hooks.py:284: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
/usr/lib/python2.7/site-packages/pluggy/manager.py:68: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python2.7/site-packages/pluggy/manager.py:62: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
/usr/lib/python2.7/site-packages/_pytest/python.py:133: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/usr/lib/python2.7/site-packages/_pytest/python.py:995: in parametrize
    function_definition=self.definition,
/usr/lib/python2.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()
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.36 seconds ============================

Comment 1 Miro Hrončok 2019-03-12 17:53:59 UTC
Pushed a fix from https://github.com/chardet/chardet/pull/174


Note You need to log in before you can comment on or make changes to this bug.