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

Include "program code" in example #15

Merged
merged 1 commit into from
May 30, 2016
Merged

Include "program code" in example #15

merged 1 commit into from
May 30, 2016

Conversation

martinmoene
Copy link
Contributor

In the example, shows both test and "program" code as well as generates output for both.

Further clarifies what context.run() does in the comment (as it puzzled me a bit at first).
I think it's better to remove (and --no-run) from the next comment as shouldExit() is not true for --no-run [1] .

Perhaps also update the (same) example The main() entry point.

[1] rename shouldExit() to mustExit() ?

@onqtam
Copy link
Member

onqtam commented May 30, 2016

oh! the -no-run thing in the comment should have been -exit - thanks for the catch!
the CI builds fail though... because the output doesn't match the reference output (because of the printf) - I will merge it and update the reference output.

I feel it's a bit too late to change the name of shouldExit().

@onqtam onqtam merged commit ffd03ec into doctest:dev May 30, 2016
@martinmoene
Copy link
Contributor Author

First the build should fail, shouldn't it (in truth I forgot about the ref. output ;)

shouldExit(), or expectsExit() is perhaps just right; programmers may have their reasons to not follow the advice to exit there. If you've watched one of Kevlin Henney's talks about testing, you may recognise my hesitation to use the word should when used in relation to testing (ca. 56 min in ;).

onqtam pushed a commit that referenced this pull request Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants