diff options
| author | Julian Andres Klode <jak@debian.org> | 2015-10-01 19:50:11 (GMT) |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2015-10-01 19:51:05 (GMT) |
| commit | 91d32c8d6c4c7b45954805776e3f44ffa0b8f47f (patch) | |
| tree | 42efaf46f91651676400e7b9ba8ecafd18f6e9d3 | |
| parent | 5bc4109b02b4c16189c6150277ae9f98f06fe539 (diff) | |
test_paths.py: Catch the IndexRecords warning
| -rw-r--r-- | tests/test_paths.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_paths.py b/tests/test_paths.py index d647e6e..4edafa9 100644 --- a/tests/test_paths.py +++ b/tests/test_paths.py @@ -111,7 +111,13 @@ class TestPath(unittest.TestCase): index.archive_uri(self.file_unicode) def test_index_records(self): - index = apt_pkg.IndexRecords() + with warnings.catch_warnings(record=True) as caught_warnings: + warnings.simplefilter("always") + index = apt_pkg.IndexRecords() + + self.assertEqual(len(caught_warnings), 1) + self.assertTrue(issubclass(caught_warnings[0].category, + DeprecationWarning)) index.load(u"./data/misc/foo_Release") index.load(b"./data/misc/foo_Release") |
