From 64a5f2fb31bdddae0f72a5cc1780c633994bb513 Mon Sep 17 00:00:00 2001
From: ulif <uli@gnufix.de>
Date: Sun, 15 Nov 2015 11:19:24 +0100
Subject: [PATCH] Reenable doctests in py modules.

We pin py.test to version < 2.8.0 to make it work with the
`--doctest-modules` option enabled. We still wait for this bug
in py.test being fixed (announced in issue tracker for 2.8.3
release of py.test).
---
 setup.cfg | 4 +---
 setup.py  | 3 ++-
 tox.ini   | 4 +++-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/setup.cfg b/setup.cfg
index 60377b1..eea600e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,9 +4,7 @@ dev = develop easy_install diceware[tests]
 docs = develop easy_install diceware[docs]
 
 [pytest]
-# py.test 2.8.2 breaks with --doctest-modules
-# See https://github.com/pytest-dev/pytest/issues/1057
-addopts = --doctest-glob='*.rst'
+addopts = --doctest-modules --doctest-glob='*.rst'
           diceware tests docs README.rst
 
 [bdist_wheel]
diff --git a/setup.py b/setup.py
index ac7d2cd..d6cb0de 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,8 @@ install_requires = [
     ]
 
 tests_require = [
-    'pytest >= 2.0.3',
+    # See tox.ini
+    'pytest >=2.0.3,<2.8.0',
     'coverage',
     ]
 
diff --git a/tox.ini b/tox.ini
index f9c2301..1ae5115 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,9 @@ envlist = flake8, pypy, py26, py27, py32, py33, py34, py35, coverage
 [testenv]
 usedevelop=True
 recreate=True
-deps=pytest
+# py.test 2.8.2 breaks with --doctest-modules in setup.cfg.
+# See https://github.com/pytest-dev/pytest/issues/1057
+deps=pytest>=2.0.3,<2.8.0
 commands=
   python setup.py test
 
-- 
GitLab