@@ -82,20 +82,11 @@ def test_valid_offset_limit(self):
82
82
@pytest .mark .xfail ((sys .version_info .major , sys .version_info .minor ) == (2 , 7 ),
83
83
reason = "python2.7 fails to generate DeprecationWarrning for unknown reason" )
84
84
def test_limit_offset_deprecation (self ):
85
- with pytest .warns (PendingDeprecationWarning ) as record :
85
+ with pytest .warns (DeprecationWarning ) as record :
86
86
pagination .LimitOffsetPagination ()
87
87
assert len (record ) == 1
88
88
assert 'LimitOffsetPagination will change in release 3.0' in str (record [0 ].message )
89
89
90
- @pytest .mark .xfail ((sys .version_info .major , sys .version_info .minor ) == (2 , 7 ),
91
- reason = "python2.7 fails to generate DeprecationWarrning for unknown reason" )
92
- def test_jsonapi_limit_offset_deprecation (self ):
93
- with pytest .warns (PendingDeprecationWarning ) as record :
94
- pagination .JsonApiLimitOffsetPagination ()
95
- assert len (record ) == 1
96
- assert 'JsonApiLimitOffsetPagination will be renamed to LimitOffsetPagination' \
97
- in str (record [0 ].message )
98
-
99
90
class MyInheritedLimitOffsetPagination (pagination .LimitOffsetPagination ):
100
91
"""
101
92
Inherit the default values
@@ -109,7 +100,7 @@ class MyOverridenLimitOffsetPagination(pagination.LimitOffsetPagination):
109
100
max_limit = None
110
101
111
102
def test_my_limit_offset_deprecation (self ):
112
- with pytest .warns (PendingDeprecationWarning ) as record :
103
+ with pytest .warns (DeprecationWarning ) as record :
113
104
self .MyInheritedLimitOffsetPagination ()
114
105
assert len (record ) == 1
115
106
assert 'LimitOffsetPagination will change in release 3.0' in str (record [0 ].message )
@@ -127,20 +118,11 @@ class TestPageNumber:
127
118
@pytest .mark .xfail ((sys .version_info .major , sys .version_info .minor ) == (2 , 7 ),
128
119
reason = "python2.7 fails to generate DeprecationWarrning for unknown reason" )
129
120
def test_page_number_deprecation (self ):
130
- with pytest .warns (PendingDeprecationWarning ) as record :
121
+ with pytest .warns (DeprecationWarning ) as record :
131
122
pagination .PageNumberPagination ()
132
123
assert len (record ) == 1
133
124
assert 'PageNumberPagination will change in release 3.0' in str (record [0 ].message )
134
125
135
- @pytest .mark .xfail ((sys .version_info .major , sys .version_info .minor ) == (2 , 7 ),
136
- reason = "python2.7 fails to generate DeprecationWarrning for unknown reason" )
137
- def test_jsonapi_page_number_deprecation (self ):
138
- with pytest .warns (PendingDeprecationWarning ) as record :
139
- pagination .JsonApiPageNumberPagination ()
140
- assert len (record ) == 1
141
- assert 'JsonApiPageNumberPagination will be renamed to PageNumberPagination' \
142
- in str (record [0 ].message )
143
-
144
126
class MyInheritedPageNumberPagination (pagination .PageNumberPagination ):
145
127
"""
146
128
Inherit the default values
@@ -157,20 +139,11 @@ class MyOverridenPageNumberPagination(pagination.PageNumberPagination):
157
139
@pytest .mark .xfail ((sys .version_info .major , sys .version_info .minor ) == (2 , 7 ),
158
140
reason = "python2.7 fails to generate DeprecationWarrning for unknown reason" )
159
141
def test_my_page_number_deprecation (self ):
160
- with pytest .warns (PendingDeprecationWarning ) as record :
142
+ with pytest .warns (DeprecationWarning ) as record :
161
143
self .MyInheritedPageNumberPagination ()
162
144
assert len (record ) == 1
163
145
assert 'PageNumberPagination will change in release 3.0' in str (record [0 ].message )
164
146
165
147
with pytest .warns (None ) as record :
166
148
self .MyOverridenPageNumberPagination ()
167
149
assert len (record ) == 0
168
-
169
- @pytest .mark .xfail ((sys .version_info .major , sys .version_info .minor ) == (2 , 7 ),
170
- reason = "python2.7 fails to generate DeprecationWarrning for unknown reason" )
171
- def test_my_jsonapi_page_number_deprecation (self ):
172
- with pytest .warns (PendingDeprecationWarning ) as record :
173
- pagination .JsonApiPageNumberPagination ()
174
- assert len (record ) == 1
175
- assert 'JsonApiPageNumberPagination will be renamed to PageNumberPagination' \
176
- in str (record [0 ].message )
0 commit comments