summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Howitz <mh@gocept.com>2019-02-09 16:57:31 +0100
committerMichael Howitz <mh@gocept.com>2019-02-09 16:57:31 +0100
commit89d7014caf2e0d02b67c08df39b3e3ec46fc7064 (patch)
tree577abf341da791415375c01e4f3dd9177c40c1c5
parente2939ad20707515fc0b1bc78102b338116dfacbf (diff)
downloadzope-configuration-89d7014caf2e0d02b67c08df39b3e3ec46fc7064.tar.gz
Do not break when running the tests from a wheel.
The wheel does neither include `setup.py` nor the `docs` dir. So omit the documentation tests when no `setup.py` can be found. This should fix the tests in ZTK.
-rw-r--r--CHANGES.rst2
-rw-r--r--src/zope/configuration/tests/test_docs.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 40be6a9..9afff86 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,7 +4,7 @@ Changes
4.3.1 (unreleased)
------------------
-- Nothing changed yet.
+- Do not break when running the tests from a wheel.
4.3.0 (2018-10-01)
diff --git a/src/zope/configuration/tests/test_docs.py b/src/zope/configuration/tests/test_docs.py
index 3452e3b..f5283fd 100644
--- a/src/zope/configuration/tests/test_docs.py
+++ b/src/zope/configuration/tests/test_docs.py
@@ -20,7 +20,6 @@ from __future__ import division
from __future__ import print_function
import re
-import sys
import os.path
import unittest
import doctest
@@ -49,12 +48,15 @@ optionflags = (
)
def test_suite():
+ suite = unittest.TestSuite()
here = os.path.dirname(os.path.abspath(__file__))
while not os.path.exists(os.path.join(here, 'setup.py')):
prev, here = here, os.path.dirname(here)
if here == prev:
# Let's avoid infinite loops at root
- raise AssertionError('could not find my setup.py')
+ print('tests_doc.py: WARNING could not find setup.py -->'
+ ' omitting documentation tests.') # pragma: no cover
+ return suite # pragma: no cover
docs = os.path.join(here, 'docs')
api_docs = os.path.join(docs, 'api')
@@ -89,7 +91,6 @@ def test_suite():
m += manuel.codeblock.Manuel()
m += manuel.capture.Manuel()
- suite = unittest.TestSuite()
suite.addTest(
manuel.testing.TestSuite(
m,