You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation of parametrize_with_checks claims that classes are accepted, but the function only accepts instances. The following example from the doc fails (launched with pytest):
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/pluggy/hooks.py:289: in __call__
returnself._hookexec(self, self.get_hookimpls(), kwargs)
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/pluggy/manager.py:87: in _hookexec
returnself._inner_hookexec(hook, methods, kwargs)
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/pluggy/manager.py:81: in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec elseFalse,
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/_pytest/python.py:225: in pytest_pycollect_makeitem
res =list(collector._genfunctions(name, obj))
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/_pytest/python.py:401: in _genfunctions
self.ihook.pytest_generate_tests(metafunc=metafunc)
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/pluggy/hooks.py:289: in __call__
returnself._hookexec(self, self.get_hookimpls(), kwargs)
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/pluggy/manager.py:87: in _hookexec
returnself._inner_hookexec(hook, methods, kwargs)
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/pluggy/manager.py:81: in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec elseFalse,
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/_pytest/python.py:128: in pytest_generate_tests
metafunc.parametrize(*marker.args, **marker.kwargs)
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/_pytest/python.py:993: in parametrize
function_definition=self.definition,
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/_pytest/mark/structures.py:122: in _for_parametrize
parameters =cls._parse_parametrize_parameters(argvalues, force_tuple)
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/_pytest/mark/structures.py:116: in _parse_parametrize_parameters
ParameterSet.extract_from(x, force_tuple=force_tuple) for x in argvalues
../../../../miniconda3/envs/py37/lib/python3.7/site-packages/_pytest/mark/structures.py:116: in <listcomp>
ParameterSet.extract_from(x, force_tuple=force_tuple) for x in argvalues
../scikit-learn/sklearn/utils/estimator_checks.py:403: in <genexpr>
for estimator, check in checks_generator)
../scikit-learn/sklearn/utils/estimator_checks.py:364: in _mark_xfail_checks
xfail_checks = _safe_tags(estimator, '_xfail_test')
../scikit-learn/sklearn/utils/estimator_checks.py:66: in _safe_tags
return estimator._get_tags().get(key, _DEFAULT_TAGS[key])
E TypeError: _get_tags() missing 1 required positional argument: 'self'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================== 1 error in 0.39 seconds ===========================================
Fix A: (quickfix) update the docstring in parametrize_with_checks to allow only instances and not classes. Also update the example in "Rolling your own estimator".
Fix B: fix the behavior to accept classes, and add a test.
The text was updated successfully, but these errors were encountered:
The documentation of
parametrize_with_checks
claims that classes are accepted, but the function only accepts instances. The following example from the doc fails (launched with pytest):Fix A: (quickfix) update the docstring in
parametrize_with_checks
to allow only instances and not classes. Also update the example in "Rolling your own estimator".Fix B: fix the behavior to accept classes, and add a test.
The text was updated successfully, but these errors were encountered: