Skip to content

Commit

Permalink
clean up test codes
Browse files Browse the repository at this point in the history
  • Loading branch information
jangxyz committed Mar 21, 2009
1 parent ea32023 commit 6d601a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
18 changes: 6 additions & 12 deletions alltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Place this file somewhere where it can be run, such as ${HOME}/bin/alltests.py
#

import testoob, unittest, sys, os, re
import unittest, sys, os, re

def find_all_test_files(filename_arg='*'):
""" finds files that end with '_test.py', recursively """
Expand Down Expand Up @@ -55,16 +55,10 @@ def suite():
return alltests

if __name__ == '__main__':
if len(sys.argv) == 4: # testfile testsuite.testcase
print sys.argv
elif len(sys.argv) == 2: # testfile
print sys.argv

test_suite = suite()
print test_suite.countTestCases()
test_suite.run(unittest.TestResult())
print unittest.TestResult()
#unittest.main(defaultTest='suite')
#testoob.main(defaultTest='suite')
try:
import testoob
testoob.main(defaultTest='suite')
except ImportError:
unittest.main(defaultTest='suite')


4 changes: 2 additions & 2 deletions test/me2day_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ def test_get_recent_posts_by_username_and_tags(self):
if __name__ == '__main__':
try:
import testoob
testoob.main()
except:
unittest.main()
except ImportError:
testoob.main()


2 changes: 1 addition & 1 deletion test/springnote_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def test_no_network_raises_exception(self):
try:
import testoob
testoob.main()
except:
except ImportError:
loader = unittest.defaultTestLoader
loader.testMethodPrefix = 'test'
unittest.main(testLoader = loader)
Expand Down

0 comments on commit 6d601a5

Please sign in to comment.