Skip to content

Instantly share code, notes, and snippets.

@Kwpolska
Created July 20, 2015 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kwpolska/de997c9ed7e1e694b239 to your computer and use it in GitHub Desktop.
Save Kwpolska/de997c9ed7e1e694b239 to your computer and use it in GitHub Desktop.
Doctests work. Really.
diff --git a/nikola/rc4.py b/nikola/rc4.py
index b46d602..e6c0c17 100644
--- a/nikola/rc4.py
+++ b/nikola/rc4.py
@@ -61,6 +61,8 @@ def rc4(key, string):
"""Encrypt things.
>>> print(rc4("Key", "Plaintext"))
u/MW6NlArwrT
+ >>> 1 == 0
+ True
"""
string.encode('utf8')
$ py.test --doctest-modules nikola/
============================= test session starts ==============================
platform linux -- Python 3.4.3 -- py-1.4.30 -- pytest-2.7.2
rootdir: /home/kwpolska/git/nikola, inifile:
plugins: cov
collected 10 items
nikola/post.py .
nikola/rc4.py F
nikola/utils.py ......
nikola/plugins/compile/markdown/mdx_gist.py .
nikola/plugins/task/sitemap/__init__.py .
=================================== FAILURES ===================================
___________________________ [doctest] nikola.rc4.rc4 ___________________________
061 """Encrypt things.
062 >>> print(rc4("Key", "Plaintext"))
063 u/MW6NlArwrT
064 >>> 1 == 0
Expected:
True
Got:
False
/home/kwpolska/git/nikola/nikola/rc4.py:64: DocTestFailure
====================== 1 failed, 9 passed in 5.54 seconds ======================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment