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
{{ message }}
Repository navigation
should doctests use print_changed_only=True? #13985
Regularly we have to change a lot of the doctests, in particular pretty unrelated parts, because we change default parameters.
I would argue that it would be better to use print_changed_only for all the doctests. That would have the positive effect of removing this extra overhead for devs.
It would also have the benefit of making examples more concise and easier to understand. If we demonstrate the setting of a particular parameter, it's easy to miss that particular parameter (or maybe it's hidden in the ellipsis even).
We can probably add a global fixture for this somewhere if we decide to do that.
Looks like adding this to sklearn/conftest.py is what we want:
@pytest.fixture(autouse=True)defprint_changed_only(doctest_namespace):
fromsklearnimportset_config# put this at the top of the file insteadset_config(print_changed_only=True)
That would require changing all the existing doctests so it would be a big PR.
I think we also want to add set_config(print_changed_only=True) in doc/conf.py for sphinx.
Activity
jnothman commentedon May 30, 2019
+1
NicolasHug commentedon May 30, 2019
Looks like adding this to
sklearn/conftest.pyis what we want:That would require changing all the existing doctests so it would be a big PR.
I think we also want to add
set_config(print_changed_only=True)indoc/conf.pyfor sphinx.Relevant docs
thomasjpfan commentedon May 30, 2019
I am +1 on this.
TomDLT commentedon May 31, 2019
+1