[MRG + 1] Make it possible to run doctests in .rst files with pytest #9697

Merged
merged 1 commit into from Sep 10, 2017

Conversation

Projects
None yet
3 participants
Member

lesteve commented Sep 6, 2017

Fix #9445.

  • doc/datasets/conftest.py to implement the equivalent of nose fixtures
  • add conftest.py in root folder to ensure that sklearn local folder
    is used rather than the package in site-packages
  • test doc with pytest in Travis
  • move custom_data_home definition from nose fixture to .rst file
Make it possible to run doctests in .rst files with pytest
* doc/datasets/conftest.py to implement the equivalent of nose fixtures
* add conftest.py in root folder to ensure that sklearn local folder
  is used rather than the package in site-packages
* test doc with pytest in Travis
* move custom_data_home definition from nose fixture to .rst file

@lesteve lesteve referenced this pull request Sep 6, 2017

Closed

[noWIP] Pytest doctests #9465

This comment has been minimized.

Show comment Hide comment
@amueller

amueller Sep 8, 2017

Owner

after this they don't run with nose any more, do they?

Owner

amueller commented Sep 8, 2017

after this they don't run with nose any more, do they?

This comment has been minimized.

Show comment Hide comment
@lesteve

lesteve Sep 8, 2017

Member

after this they don't run with nose any more, do they?

doctests still run fine with nose. The Travis build are exactly as before with 3 builds using nose and 1 using pytest.

Member

lesteve commented Sep 8, 2017

after this they don't run with nose any more, do they?

doctests still run fine with nose. The Travis build are exactly as before with 3 builds using nose and 1 using pytest.

This comment has been minimized.

Show comment Hide comment
@amueller

amueller Sep 8, 2017

Owner

But the fixtures are not run any more for nosetests, right? So that means it downloads the datasets?

Owner

amueller commented Sep 8, 2017

But the fixtures are not run any more for nosetests, right? So that means it downloads the datasets?

This comment has been minimized.

Show comment Hide comment
@lesteve

lesteve Sep 9, 2017

Member

The nose fixtures files i.e. *_fixture.py are still there so for nose everything is behaving as previously. The only thing I did was to put the custom_data_home definition in the mldata.rst rather than in the fixture globs. Although there is doctest_namespace that is similar for pytest, the complication did not seem worth the effort IMO.

Member

lesteve commented Sep 9, 2017

The nose fixtures files i.e. *_fixture.py are still there so for nose everything is behaving as previously. The only thing I did was to put the custom_data_home definition in the mldata.rst rather than in the fixture globs. Although there is doctest_namespace that is similar for pytest, the complication did not seem worth the effort IMO.

This comment has been minimized.

Show comment Hide comment
@amueller

amueller Sep 10, 2017

Owner

ah ok, lgtm

Owner

amueller commented Sep 10, 2017

ah ok, lgtm

@amueller amueller changed the title from [MRG] Make it possible to run doctests in .rst files with pytest to [MRG + 1] Make it possible to run doctests in .rst files with pytest Sep 10, 2017

@jnothman jnothman merged commit ea41a78 into scikit-learn:master Sep 10, 2017

6 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing fb64216...8072a8f
Details
codecov/project 96.17% remains the same compared to fb64216
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
lgtm analysis: Python No alert changes
Details

jnothman added a commit to jnothman/scikit-learn that referenced this pull request Sep 12, 2017

CI Make it possible to run doctests in .rst files with pytest (#9697)
* doc/datasets/conftest.py to implement the equivalent of nose fixtures
* add conftest.py in root folder to ensure that sklearn local folder
  is used rather than the package in site-packages
* test doc with pytest in Travis
* move custom_data_home definition from nose fixture to .rst file

amueller added a commit to amueller/scikit-learn that referenced this pull request Sep 12, 2017

CI Make it possible to run doctests in .rst files with pytest (#9697)
* doc/datasets/conftest.py to implement the equivalent of nose fixtures
* add conftest.py in root folder to ensure that sklearn local folder
  is used rather than the package in site-packages
* test doc with pytest in Travis
* move custom_data_home definition from nose fixture to .rst file

massich added a commit to massich/scikit-learn that referenced this pull request Sep 15, 2017

CI Make it possible to run doctests in .rst files with pytest (#9697)
* doc/datasets/conftest.py to implement the equivalent of nose fixtures
* add conftest.py in root folder to ensure that sklearn local folder
  is used rather than the package in site-packages
* test doc with pytest in Travis
* move custom_data_home definition from nose fixture to .rst file

amueller added a commit to amueller/scikit-learn that referenced this pull request Sep 19, 2017

Don't modify steps in Pipeline.__init__
remove outdated comment

fix also for FeatureUnion

[MRG+2] Limiting n_components by both n_features and n_samples instead of just n_features (Recreated PR) (#8742)

[MRG+1] Remove hard dependency on nose (#9670)

MAINT Stop vendoring sphinx-gallery (#9403)

CI upgrade travis to run on new numpy release (#9096)

CI Make it possible to run doctests in .rst files with pytest (#9697)

* doc/datasets/conftest.py to implement the equivalent of nose fixtures
* add conftest.py in root folder to ensure that sklearn local folder
  is used rather than the package in site-packages
* test doc with pytest in Travis
* move custom_data_home definition from nose fixture to .rst file

[MRG+1] avoid integer overflow by using floats for matthews_corrcoef (#9693)

* Fix bug#9622: avoid integer overflow by using floats for matthews_corrcoef

* matthews_corrcoef: cosmetic change requested by jnothman

* Add test_matthews_corrcoef_overflow for Bug#9622

* test_matthews_corrcoef_overflow: clean-up and make deterministic

* matthews_corrcoef: pass dtype=np.float64 to sum & trace instead of using astype

* test_matthews_corrcoef_overflow: add simple deterministic tests

TST Platform independent hash collision tests in FeatureHasher (#9710)

TST More informative error message in test_preserve_trustworthiness_approximately (#9738)

add some rudimentary tests for meta-estimators

fix extra whitespace in error message

add missing if_delegate_has_method in pipeline

don't test tuple pipeline for now

only copy list if not list already? doesn't seem to help?

@lesteve lesteve deleted the lesteve:run-doctests-with-pytest branch Oct 20, 2017

maskani-moh added a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017

CI Make it possible to run doctests in .rst files with pytest (#9697)
* doc/datasets/conftest.py to implement the equivalent of nose fixtures
* add conftest.py in root folder to ensure that sklearn local folder
  is used rather than the package in site-packages
* test doc with pytest in Travis
* move custom_data_home definition from nose fixture to .rst file

jwjohnson314 pushed a commit to jwjohnson314/scikit-learn that referenced this pull request Dec 18, 2017

CI Make it possible to run doctests in .rst files with pytest (#9697)
* doc/datasets/conftest.py to implement the equivalent of nose fixtures
* add conftest.py in root folder to ensure that sklearn local folder
  is used rather than the package in site-packages
* test doc with pytest in Travis
* move custom_data_home definition from nose fixture to .rst file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment