# HG changeset patch # User Jeff Hammel # Date 1330466061 28800 # Node ID 9879140a2026ed4ee74cef91a0e3b4137d68e748 # Parent 15c7171941ea6e9bdd523ea4c3bffa12ec679ffe begin stubbing test app diff -r 15c7171941ea -r 9879140a2026 tests/test.py --- 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()