Mercurial > hg > simpypi
changeset 9:9879140a2026
begin stubbing test app
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 28 Feb 2012 13:54:21 -0800 |
parents | 15c7171941ea |
children | 3e8597489ea3 |
files | tests/test.py |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test.py Tue Feb 28 13:50:28 2012 -0800 +++ b/tests/test.py Tue Feb 28 13:54:21 2012 -0800 @@ -7,11 +7,17 @@ import doctest import os import shutil +import simpypi import sys import tempfile from optparse import OptionParser from paste.fixture import TestApp +class SimpypiTestApp(TestApp): + """WSGI app wrapper for testing simpypi""" + + + def run_tests(raise_on_error=False, report_first=False): # add results here @@ -35,6 +41,9 @@ tmpdir = tempfile.mkdtemp() doctest_args['extraglobs']['directory'] = tmpdir + # make a test WSGI app + app = simpypi. + try: results[test] = doctest.testfile(test, **doctest_args) except doctest.DocTestFailure, failure: @@ -63,7 +72,6 @@ results = run_tests(**options.__dict__) if sum([i.failed for i in results.values()]): sys.exit(1) # error - if __name__ == '__main__': main()