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

Doctests should not need to import odl #410

Closed
kohr-h opened this issue May 29, 2016 · 7 comments
Closed

Doctests should not need to import odl #410

kohr-h opened this issue May 29, 2016 · 7 comments

Comments

@kohr-h
Copy link
Member

kohr-h commented May 29, 2016

EDIT: hit the Enter button too early, here comes the text.

When writing running the doctests, often times one needs some functionality from another part of the library. Then, an explicit import odl is necessary, otherwise pytest complains. I noticed that in Numpy, they don't have to do that. Probably one can tell the doctest module thing what to import before running. I'll investigate that possibility.

@adler-j
Copy link
Member

adler-j commented May 29, 2016

Any idea on how to do this?

@kohr-h
Copy link
Member Author

kohr-h commented May 29, 2016

In Numpy, they modify the test context by injecting numpy under the name np into all doctests. I'm not quite sure how to do that in pytest, but it must be possible.

@adler-j
Copy link
Member

adler-j commented May 29, 2016

Seems that we would need to do something similar to that then.

@kohr-h
Copy link
Member Author

kohr-h commented May 29, 2016

Actually there is a functionality in pytest as shown in this pull request. It's been merged into the features branch but not yet to master. So at best, it becomes available in version 2.9.2. We'll have to wait.

@adler-j
Copy link
Member

adler-j commented May 29, 2016

That would require us to wait quite noticable time, at least half a few months after release, to allow people to catch up.

@kohr-h
Copy link
Member Author

kohr-h commented May 29, 2016

Sure. We can still keep this issue open until then, just to remember it. Requiring a very new version of pytest is anyway only possible as soon as the major distributions provide it. Or we guarantee testing support only for installations using pip or conda where the newest packages are available.

@adler-j
Copy link
Member

adler-j commented Nov 8, 2016

This is done.

@adler-j adler-j closed this as completed Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants