Skip to content
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

DOC: make it possible to run doctests #15626

Merged
merged 1 commit into from
Mar 9, 2017

Conversation

jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented Mar 8, 2017

This adds a small entry in the conftest.py file, which makes it possible to run doctests with eg

pytest --doctests-module pandas/core/series.py

We are far from being able to run them all without error, and if we would want that is even another question (it may be too much small details to pay attention to), but this let's you at least run specific doctests.

@jreback
Copy link
Contributor

jreback commented Mar 8, 2017

@jorisvandenbossche this is great. I would propose you add a script ci/script_doctests.py, add it in .travis.yml after script_multi.py and you just put the actual testing command / commands as we add things.

So then as things are fixed can be added there w/o impacting anything else.

@jreback
Copy link
Contributor

jreback commented Mar 8, 2017

if you want to get really fancy we can add an env variable DOC_TESTS to only run them on selective builds (e.g. 3.6/2.7).

@jreback
Copy link
Contributor

jreback commented Mar 8, 2017

We are far from being able to run them all without error, and if we would want that is even another question (it may be too much small details to pay attention to), but this let's you at least run specific doctests.

If we can automate the running, why not. Having manually run tests is like not having tests :>

@jorisvandenbossche
Copy link
Member Author

If we can automate the running, why not.

Because we may find it is too much work to keep it working. The doctesting ensures the example are correct (which is important!), but it is also quite nitpicky and it has to be exactly correct.
#15625 is an example of adjustments needed to make them pass (but that PR also fixed an actual error in the example, apart from more stylistic changes). So might be good to first get some experience with to see how it goes.

@jreback
Copy link
Contributor

jreback commented Mar 8, 2017

ok. well if they are fixed in a particular file we should then test them to keep them working :>

@jorisvandenbossche
Copy link
Member Author

Yes, we can certainly add that when certain files pass

@jorisvandenbossche jorisvandenbossche merged commit 1a75f49 into pandas-dev:master Mar 9, 2017
AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
@jorisvandenbossche jorisvandenbossche deleted the doctests branch February 12, 2018 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants