Skip to content

Commit

Permalink
Merge pull request #46 from zopefoundation/fix-ztk-tests
Browse files Browse the repository at this point in the history
Do not break when running the tests from a wheel.
  • Loading branch information
Michael Howitz committed Feb 12, 2019
2 parents e2939ad + 49260be commit 9552d08
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Expand Up @@ -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)
Expand Down
13 changes: 10 additions & 3 deletions src/zope/configuration/tests/test_docs.py
Expand Up @@ -20,7 +20,6 @@
from __future__ import print_function

import re
import sys
import os.path
import unittest
import doctest
Expand Down Expand Up @@ -49,12 +48,21 @@
)

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')
class SkippedDocTests(unittest.TestCase): # pragma: no cover

@unittest.skip('Could not find setup.py')
def test_docs(self):
pass

suite.addTest(
unittest.makeSuite(SkippedDocTests)) # pragma: no cover
return suite # pragma: no cover

docs = os.path.join(here, 'docs')
api_docs = os.path.join(docs, 'api')
Expand Down Expand Up @@ -89,7 +97,6 @@ def test_suite():
m += manuel.codeblock.Manuel()
m += manuel.capture.Manuel()

suite = unittest.TestSuite()
suite.addTest(
manuel.testing.TestSuite(
m,
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -14,7 +14,7 @@ basepython =
python3.6
commands =
coverage run -m zope.testrunner --test-path=src --all
coverage report --fail-under=100
coverage report --show-missing --skip-covered --fail-under=100
deps =
{[testenv]deps}
coverage
Expand Down

0 comments on commit 9552d08

Please sign in to comment.