Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreisen-cfpb committed Jan 29, 2014
1 parent f548324 commit 0da3512
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
4 changes: 2 additions & 2 deletions example_app/tests.py
Expand Up @@ -4,9 +4,9 @@

class ExampleTest(TestCase):
def test_failing(self):
""" This is a failing unit test """
""" This is a failing unit test """
self.assertTrue(False)

def test_passing(self):
""" This is a passing unit test """
""" This is a passing unit test """
self.assertTrue(True)
29 changes: 1 addition & 28 deletions tests.py
Expand Up @@ -4,7 +4,7 @@
class BehaveTest(unittest.TestCase):
def run_test(self, app='example_app', settings='example_proj.settings', *args, **kwargs):
"""
test the given app with thiegiven args and kwargs passed to manage.py. kwargs are converted from
test the given app with the given args and kwargs passed to manage.py. kwargs are converted from
{'a': 'b'} to --a=b
returns a tuple: (stdout, stderr)
Expand All @@ -31,30 +31,3 @@ def test_runner_with_old_tag_specified_expect_only_old_bdd_test_run(self):

if __name__ == '__main__':
unittest.main()

"""
import subprocess
p = subprocess.Popen(['./manage.py', 'test', 'example_app', '--failfast', '--settings=example_proj.settings'], stdout=subprocess.PIPE)
out = p.communicate()[0]
import sys
from cStringIO import StringIO
def test():
backup_out = sys.stdout
sys.stdout = StringIO()
backup_err = sys.stderr
sys.stderr = StringIO()
try:
from django.core.management import call_command
call_command('test', 'example_app')
except SystemExit:
print 'attempted exit!'
out = sys.stdout.getvalue()
err = sys.stderr.getvalue()
sys.stdout.close()
sys.stderr.close()
sys.stdout = backup_out
sys.stderr = backup_err
return out, err
"""

0 comments on commit 0da3512

Please sign in to comment.