summaryrefslogtreecommitdiff
path: root/dev-python/parameterized/files/parameterized-0.8.1-nose-to-pytest.patch
blob: 45b86d8a13af16c6a0ce1326942fb9ef63ea4f36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
diff --git a/parameterized/test.py b/parameterized/test.py
index f98d865..ede7689 100644
--- a/parameterized/test.py
+++ b/parameterized/test.py
@@ -2,8 +2,8 @@
 
 import inspect
 import mock
+import pytest
 from unittest import TestCase
-from nose.tools import assert_equal, assert_raises
 
 from .parameterized import (
     PY3, PY2, parameterized, param, parameterized_argument_value_pairs,
@@ -91,7 +91,7 @@ if not PYTEST:
 
         @parameterized([(1, ), (2, )])
         def test_setup(self, count, *a):
-            assert_equal(self.actual_order, "setup %s" %(count, ))
+            assert self.actual_order == "setup %s" %(count, )
             missing_tests.remove("test_setup(%s)" %(self.actual_order, ))
 
 
@@ -235,9 +235,9 @@ class TestParamerizedOnTestCase(TestCase):
         frame_locals = frame[0].f_locals
         nose_test_method_name = frame_locals['a'][0]._testMethodName
         expected_name = "test_on_TestCase2_custom_name_" + str(foo)
-        assert_equal(nose_test_method_name, expected_name,
-                     "Test Method name '%s' did not get customized to expected: '%s'" %
-                     (nose_test_method_name, expected_name))
+        assert nose_test_method_name == expected_name, \
+                     "Test Method name '%s' did not get customized to expected: '%s'" % \
+                     (nose_test_method_name, expected_name)
         missing_tests.remove("%s(%r, bar=%r)" %(expected_name, foo, bar))
 
 
@@ -259,7 +259,7 @@ class TestParameterizedExpandDocstring(TestCase):
         actual_docstring = test_method.__doc__
         if rstrip:
             actual_docstring = actual_docstring.rstrip()
-        assert_equal(actual_docstring, expected_docstring)
+        assert actual_docstring == expected_docstring
 
     @parameterized.expand([param("foo")],
                           doc_func=lambda f, n, p: "stuff")
@@ -335,7 +335,7 @@ def test_helpful_error_on_empty_iterable_input():
 
 def test_skip_test_on_empty_iterable():
     func = parameterized([], skip_on_empty=True)(lambda: None)
-    assert_raises(SkipTest, func)
+    pytest.raises(SkipTest, func)
 
 
 def test_helpful_error_on_empty_iterable_input_expand():
@@ -366,10 +366,6 @@ def test_helpful_error_on_non_iterable_input():
         raise AssertionError("Expected exception not raised")
 
 
-def tearDownModule():
-    missing = sorted(list(missing_tests))
-    assert_equal(missing, [])
-
 def test_old_style_classes():
     if PY3:
         raise SkipTest("Py3 doesn't have old-style classes")
@@ -418,7 +414,7 @@ class TestOldStyleClass:
 def test_parameterized_argument_value_pairs(func_params, p, expected):
     helper = eval("lambda %s: None" %(func_params, ))
     actual = parameterized_argument_value_pairs(helper, p)
-    assert_equal(actual, expected)
+    assert actual == expected
 
 
 @parameterized([
@@ -428,7 +424,7 @@ def test_parameterized_argument_value_pairs(func_params, p, expected):
     (123456789, "12...89", 4),
 ])
 def test_short_repr(input, expected, n=6):
-    assert_equal(short_repr(input, n=n), expected)
+    assert short_repr(input, n=n) == expected
 
 @parameterized([
     ("foo", ),
@@ -442,7 +438,7 @@ cases_over_10 = [(i, i+1) for i in range(11)]
 
 @parameterized(cases_over_10)
 def test_cases_over_10(input, expected):
-    assert_equal(input, expected-1)
+    assert input == expected-1
 
 
 @parameterized_class(("a", "b", "c"), [
@@ -461,7 +457,7 @@ class TestParameterizedClass(TestCase):
 
     def _assertions(self, test_name):
         assert hasattr(self, "a")
-        assert_equal(self.b + self.c, 3)
+        assert self.b + self.c == 3
         missing_tests.remove("%s:%s(%r, %r, %r)" %(
             self.__class__.__name__,
             test_name,