diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-12-25 21:07:27 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-12-29 21:59:07 +0100 |
| commit | ef017a5f00d9e84059e00e8fea123be51b293f75 (patch) | |
| tree | ff0bf6ebfb015465e1ceee3d2551f1c7a200d07f /tests | |
| parent | 130829334c32f48b9ba6e6251d0e780c0d99cd4d (diff) | |
Advanced pending deprecation warnings.
Also added stacklevel argument, fixed #18127.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/httpwrappers/tests.py | 12 | ||||
| -rw-r--r-- | tests/regressiontests/utils/datastructures.py | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py index d26a728e7b..67172d963c 100644 --- a/tests/regressiontests/httpwrappers/tests.py +++ b/tests/regressiontests/httpwrappers/tests.py @@ -326,13 +326,13 @@ class HttpResponseTests(unittest.TestCase): r = HttpResponse() r.content = ['1', '2', 3, '\u079e'] with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always", PendingDeprecationWarning) + warnings.simplefilter("always", DeprecationWarning) my_iter = iter(r) - self.assertEqual(w[0].category, PendingDeprecationWarning) + self.assertEqual(w[0].category, DeprecationWarning) with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always", PendingDeprecationWarning) + warnings.simplefilter("always", DeprecationWarning) result = list(my_iter) - self.assertEqual(w[0].category, PendingDeprecationWarning) + self.assertEqual(w[0].category, DeprecationWarning) #'\xde\x9e' == unichr(1950).encode('utf-8') self.assertEqual(result, [b'1', b'2', b'3', b'\xde\x9e']) self.assertEqual(r.content, b'123\xde\x9e') @@ -360,7 +360,7 @@ class HttpResponseTests(unittest.TestCase): # XXX change this when the deprecation completes in HttpResponse r = HttpResponse(iter(['hello', 'world'])) with warnings.catch_warnings(): - warnings.simplefilter("ignore", PendingDeprecationWarning) + warnings.simplefilter("ignore", DeprecationWarning) self.assertEqual(b''.join(r), b'helloworld') self.assertEqual(r.content, b'') # not the expected result! @@ -497,7 +497,7 @@ class FileCloseTests(TestCase): r = HttpResponse(file1) self.assertFalse(file1.closed) with warnings.catch_warnings(): - warnings.simplefilter("ignore", PendingDeprecationWarning) + warnings.simplefilter("ignore", DeprecationWarning) list(r) self.assertFalse(file1.closed) r.close() diff --git a/tests/regressiontests/utils/datastructures.py b/tests/regressiontests/utils/datastructures.py index f65fc5c770..3161c04f97 100644 --- a/tests/regressiontests/utils/datastructures.py +++ b/tests/regressiontests/utils/datastructures.py @@ -139,14 +139,14 @@ class SortedDictTests(SimpleTestCase): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") d.insert(0, "hello", "world") - assert w[0].category is PendingDeprecationWarning + assert w[0].category is DeprecationWarning def test_value_for_index(self): d = SortedDict({"a": 3}) with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") self.assertEqual(d.value_for_index(0), 3) - assert w[0].category is PendingDeprecationWarning + assert w[0].category is DeprecationWarning class MergeDictTests(SimpleTestCase): |
