##// END OF EJS Templates
[testing][tests][tools] Remove nose
Samuel Gaist -
Show More
@@ -17,8 +17,6 b' Tests for testing.tools'
17 import os
17 import os
18 import unittest
18 import unittest
19
19
20 import nose.tools as nt
21
22 from IPython.testing import decorators as dec
20 from IPython.testing import decorators as dec
23 from IPython.testing import tools as tt
21 from IPython.testing import tools as tt
24
22
@@ -28,26 +26,26 b' from IPython.testing import tools as tt'
28
26
29 @dec.skip_win32
27 @dec.skip_win32
30 def test_full_path_posix():
28 def test_full_path_posix():
31 spath = '/foo/bar.py'
29 spath = "/foo/bar.py"
32 result = tt.full_path(spath,['a.txt','b.txt'])
30 result = tt.full_path(spath, ["a.txt", "b.txt"])
33 nt.assert_equal(result, ['/foo/a.txt', '/foo/b.txt'])
31 assert result, ["/foo/a.txt" == "/foo/b.txt"]
34 spath = '/foo'
32 spath = "/foo"
35 result = tt.full_path(spath,['a.txt','b.txt'])
33 result = tt.full_path(spath, ["a.txt", "b.txt"])
36 nt.assert_equal(result, ['/a.txt', '/b.txt'])
34 assert result, ["/a.txt" == "/b.txt"]
37 result = tt.full_path(spath,'a.txt')
35 result = tt.full_path(spath, "a.txt")
38 nt.assert_equal(result, ['/a.txt'])
36 assert result == ["/a.txt"]
39
37
40
38
41 @dec.skip_if_not_win32
39 @dec.skip_if_not_win32
42 def test_full_path_win32():
40 def test_full_path_win32():
43 spath = 'c:\\foo\\bar.py'
41 spath = "c:\\foo\\bar.py"
44 result = tt.full_path(spath,['a.txt','b.txt'])
42 result = tt.full_path(spath, ["a.txt", "b.txt"])
45 nt.assert_equal(result, ['c:\\foo\\a.txt', 'c:\\foo\\b.txt'])
43 assert result, ["c:\\foo\\a.txt" == "c:\\foo\\b.txt"]
46 spath = 'c:\\foo'
44 spath = "c:\\foo"
47 result = tt.full_path(spath,['a.txt','b.txt'])
45 result = tt.full_path(spath, ["a.txt", "b.txt"])
48 nt.assert_equal(result, ['c:\\a.txt', 'c:\\b.txt'])
46 assert result, ["c:\\a.txt" == "c:\\b.txt"]
49 result = tt.full_path(spath,'a.txt')
47 result = tt.full_path(spath, "a.txt")
50 nt.assert_equal(result, ['c:\\a.txt'])
48 assert result == ["c:\\a.txt"]
51
49
52
50
53 def test_parser():
51 def test_parser():
@@ -56,8 +54,8 b' def test_parser():'
56 both = ("FAILED (errors=1, failures=1)", 1, 1)
54 both = ("FAILED (errors=1, failures=1)", 1, 1)
57 for txt, nerr, nfail in [err, fail, both]:
55 for txt, nerr, nfail in [err, fail, both]:
58 nerr1, nfail1 = tt.parse_test_output(txt)
56 nerr1, nfail1 = tt.parse_test_output(txt)
59 nt.assert_equal(nerr, nerr1)
57 assert nerr == nerr1
60 nt.assert_equal(nfail, nfail1)
58 assert nfail == nfail1
61
59
62
60
63 def test_temp_pyfile():
61 def test_temp_pyfile():
@@ -66,7 +64,7 b' def test_temp_pyfile():'
66 assert os.path.isfile(fname)
64 assert os.path.isfile(fname)
67 with open(fname) as fh2:
65 with open(fname) as fh2:
68 src2 = fh2.read()
66 src2 = fh2.read()
69 nt.assert_equal(src2, src)
67 assert src2 == src
70
68
71 class TestAssertPrints(unittest.TestCase):
69 class TestAssertPrints(unittest.TestCase):
72 def test_passing(self):
70 def test_passing(self):
General Comments 0
You need to be logged in to leave comments. Login now