Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Commit

Permalink
Refactored doctest helpers out into docsix.
Browse files Browse the repository at this point in the history
  • Loading branch information
nyergler committed Feb 19, 2014
1 parent 70fe72d commit 0fe306a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 86 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
tests_require=[
'django-discover-runner',
'manuel',
'docsix',
'mock',
],
test_suite='rebar.tests.run_tests',
Expand Down
42 changes: 10 additions & 32 deletions src/rebar/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import doctest
import glob
import os
import sys

import manuel.codeblock
import manuel.doctest
import manuel.testing

from rebar.tests.manuel_ext import (
testcode,
unicode_output,
)
from docsix import get_doctest_suite


def setup():
Expand All @@ -29,28 +21,6 @@ def setup():
django.setup()


def get_doctest_suite():
"""Return the doctest suite."""

m = manuel.doctest.Manuel(
parser=unicode_output.PermissiveUnicodeDocTestParser(),
optionflags=doctest.ELLIPSIS,
)
m += manuel.codeblock.Manuel()
m += testcode.Manuel()

return manuel.testing.TestSuite(
m,
*[
os.path.join(
os.getcwd(),
path,
)
for path in glob.glob('docs/*.rst')
]
)


def run_tests():

setup()
Expand All @@ -63,7 +33,15 @@ def run_tests():

failures = test_runner.run_tests(
['rebar'],
extra_tests=get_doctest_suite(),
extra_tests=get_doctest_suite(
[
os.path.join(
os.getcwd(),
path,
)
for path in glob.glob('docs/*.rst')
]
),
)

sys.exit(failures)
Expand Down
Empty file.
30 changes: 0 additions & 30 deletions src/rebar/tests/manuel_ext/testcode.py

This file was deleted.

23 changes: 0 additions & 23 deletions src/rebar/tests/manuel_ext/unicode_output.py

This file was deleted.

0 comments on commit 0fe306a

Please sign in to comment.