Skip to content

Commit

Permalink
TST Remove python unittest boilerplate...
Browse files Browse the repository at this point in the history
...since nose is used
  • Loading branch information
kwgoodman committed Mar 19, 2013
1 parent 919e15e commit 67cc43b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 68 deletions.
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -122,9 +122,9 @@ After you have installed ``la``, run the suite of unit tests::
>>> import la >>> import la
>>> la.test() >>> la.test()
<snip> <snip>
Ran 2997 tests in 9.225s Ran 2996 tests in 9.225s
OK OK
<nose.result.TextTestResult run=2997 errors=0 failures=0> <nose.result.TextTestResult run=2996 errors=0 failures=0>
The ``la`` package contains C extensions that speed up common alignment The ``la`` package contains C extensions that speed up common alignment
operations such as adding two unaligned larrys. If the C extensions don't operations such as adding two unaligned larrys. If the C extensions don't
Expand Down
23 changes: 0 additions & 23 deletions la/tests/deflarry_test.py
Expand Up @@ -3529,29 +3529,6 @@ def test_vacuum8(self):
assert_almost_equal(larv.x, larr.x) assert_almost_equal(larv.x, larr.x)
assert_(larv.label == larr.label) assert_(larv.label == larr.label)



def suite():
s = []
u = unittest.TestLoader().loadTestsFromTestCase
s.append(u(Test_init))
s.append(u(Test_unary))
s.append(u(Test_binary))
s.append(u(Test_reduce))
s.append(u(Test_comparison))
s.append(u(Test_anyall))
s.append(u(Test_getset))
s.append(u(Test_label))
s.append(u(Test_calc))
s.append(u(Test_alignment))
s.append(u(Test_properties_01))
return unittest.TestSuite(s)

def run():
unittest.TextTestRunner(verbosity=2).run(suite())

if __name__ == '__main__':
run()

# take test ----------------------------------------------------------------- # take test -----------------------------------------------------------------


# Make sure larry.take gives the same result as larry.__getitem__. # Make sure larry.take gives the same result as larry.__getitem__.
Expand Down
13 changes: 0 additions & 13 deletions la/tests/io_test.py
Expand Up @@ -95,19 +95,6 @@ def test_io_6(self):
actual = io['desired'][:] actual = io['desired'][:]
assert_larry_equal(actual, desired) assert_larry_equal(actual, desired)


def testsuite():
s = []
u = unittest.TestLoader().loadTestsFromTestCase
s.append(u(Test_io))
return unittest.TestSuite(s)

def run():
suite = testsuite()
unittest.TextTestRunner(verbosity=2).run(suite)

if __name__ == '__main__':
run()

# nose tests ---------------------------------------------------------------- # nose tests ----------------------------------------------------------------


def datetime_test(): def datetime_test():
Expand Down
16 changes: 0 additions & 16 deletions la/tests/missing_test.py
Expand Up @@ -198,19 +198,3 @@ def test_ismissing_8a(self):
def test_ismissing_9a(self): def test_ismissing_9a(self):
"afunc.ismissing_9a" "afunc.ismissing_9a"
assert_equal(ismissing(np.array([True])), np.array([False])) assert_equal(ismissing(np.array([True])), np.array([False]))

# Unit tests ----------------------------------------------------------------

def suite():

unit = unittest.TestLoader().loadTestsFromTestCase
s = []
s.append(unit(Test_nans))
s.append(unit(Test_missing_marker))
s.append(unit(Test_ismissing))
return unittest.TestSuite(s)

def run():
suite = testsuite()
unittest.TextTestRunner(verbosity=2).run(suite)

14 changes: 0 additions & 14 deletions la/util/tests/misc_test.py
Expand Up @@ -38,17 +38,3 @@ def test_isa():
yield assert_equal, isfloat(key), value[1], msg yield assert_equal, isfloat(key), value[1], msg
msg = '\nisscalar(' + str(key) + ')' msg = '\nisscalar(' + str(key) + ')'
yield assert_equal, isscalar(key), (value[0] or value[1]), msg yield assert_equal, isscalar(key), (value[0] or value[1]), msg

def suite():
s = []
u = unittest.TestLoader().loadTestsFromTestCase
s.append(u(Test_misc))
return unittest.TestSuite(s)

def run():
suite = suite()
unittest.TextTestRunner(verbosity=2).run(suite)

if __name__ == '__main__':
run()

0 comments on commit 67cc43b

Please sign in to comment.