summaryrefslogtreecommitdiff
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-07 14:10:28 +0200
committerGeorg Brandl <georg@python.org>2014-10-07 14:10:28 +0200
commit9a51e6a6df8a56aebede133687e91e519a186122 (patch)
treeffebef0e0f0b63c2749e2858fdc50972a336fc2b /tests/test_util.py
parent9cbc7803dd8e7826393721fe4acbd702843e131c (diff)
downloadpygments-9a51e6a6df8a56aebede133687e91e519a186122.tar.gz
Closes #980: fix DeprecationWarnings (mostly due to files closed by __del__) on Py3.
Also fix a bunch of other uses of open() to use the with statement.
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 6aee2c26..7bf03409 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -123,7 +123,7 @@ class UtilTest(unittest.TestCase):
r = re.compile(util.unirange(0x10000, 0x20000))
m = r.match(first_non_bmp)
self.assertTrue(m)
- self.assertEquals(m.end(), len(first_non_bmp))
+ self.assertEqual(m.end(), len(first_non_bmp))
self.assertFalse(r.match(u'\uffff'))
self.assertFalse(r.match(u'xxx'))
# Tests that end is inclusive
@@ -132,7 +132,7 @@ class UtilTest(unittest.TestCase):
# build
m = r.match(first_non_bmp * 2)
self.assertTrue(m)
- self.assertEquals(m.end(), len(first_non_bmp) * 2)
+ self.assertEqual(m.end(), len(first_non_bmp) * 2)
def test_format_lines(self):
lst = ['cat', 'dog']
@@ -140,4 +140,4 @@ class UtilTest(unittest.TestCase):
d = {}
exec(output, d)
self.assertTrue(isinstance(d['var'], tuple))
- self.assertEquals(('cat', 'dog'), d['var'])
+ self.assertEqual(('cat', 'dog'), d['var'])