Skip to content

Instantly share code, notes, and snippets.

@chaudum
Created August 9, 2018 11:34
Show Gist options
  • Save chaudum/6b8000ff428bdbf2d15fcb83acb4e3dd to your computer and use it in GitHub Desktop.
Save chaudum/6b8000ff428bdbf2d15fcb83acb4e3dd to your computer and use it in GitHub Desktop.
$ python
Python 3.7.0 (default, Jun 27 2018, 14:40:03)
[GCC 8.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print(open("testme.md").read())
# Hello World
Example:
>>> 2 + 2
4
Faling example:
>>> 2 + 2
3
>>>
>>> import doctest
>>> doctest.testfile("testme.md")
**********************************************************************
File "./testme.md", line 10, in testme.md
Failed example:
2 + 2
Expected:
3
Got:
4
**********************************************************************
1 items had failures:
1 of 2 in testme.md
***Test Failed*** 1 failures.
TestResults(failed=1, attempted=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment