[pypy-commit] pypy unicode-utf8-py3: fix lib_pypy tests

mattip pypy.commits at gmail.com
Mon Aug 13 12:41:15 EDT 2018


Author: Matti Picus <matti.picus at gmail.com>
Branch: unicode-utf8-py3
Changeset: r95003:82a40174a16f
Date: 2018-08-12 15:00 -0700
http://bitbucket.org/pypy/pypy/changeset/82a40174a16f/

Log:	fix lib_pypy tests

diff --git a/pypy/module/test_lib_pypy/test_md5_extra.py b/pypy/module/test_lib_pypy/test_md5_extra.py
--- a/pypy/module/test_lib_pypy/test_md5_extra.py
+++ b/pypy/module/test_lib_pypy/test_md5_extra.py
@@ -80,7 +80,7 @@
 
             space.call_method(w_m2c, 'update', space.newbytes(message))
             w_d2 = space.call_method(w_m2c, 'hexdigest')
-            d2 = space.str_w(w_d2)
+            d2 = space.text_w(w_d2)
 
             assert d1 == d2
 
diff --git a/pypy/module/test_lib_pypy/test_resource.py b/pypy/module/test_lib_pypy/test_resource.py
--- a/pypy/module/test_lib_pypy/test_resource.py
+++ b/pypy/module/test_lib_pypy/test_resource.py
@@ -1,14 +1,15 @@
 from __future__ import absolute_import
 import sys
+import pytest
 
 import os
 if os.name != 'posix':
-    skip('resource.h only available on unix')
+    pytest.skip('resource.h only available on unix')
 
 try:
     from lib_pypy import resource
 except (ImportError, SyntaxError) as e:
-    skip(str(e))
+    pytest.skip(str(e))
 
 
 def test_getrusage():
diff --git a/pypy/module/test_lib_pypy/test_sqlite3.py b/pypy/module/test_lib_pypy/test_sqlite3.py
--- a/pypy/module/test_lib_pypy/test_sqlite3.py
+++ b/pypy/module/test_lib_pypy/test_sqlite3.py
@@ -274,14 +274,14 @@
     def test_null_character(self, con):
         if not hasattr(_sqlite3, '_ffi') and sys.version_info < (2, 7, 9):
             pytest.skip("_sqlite3 too old")
-        exc = raises(ValueError, con, "\0select 1")
+        exc = pytest.raises(ValueError, con, "\0select 1")
         assert str(exc.value) == "the query contains a null character"
-        exc = raises(ValueError, con, "select 1\0")
+        exc = pytest.raises(ValueError, con, "select 1\0")
         assert str(exc.value) == "the query contains a null character"
         cur = con.cursor()
-        exc = raises(ValueError, cur.execute, "\0select 2")
+        exc = pytest.raises(ValueError, cur.execute, "\0select 2")
         assert str(exc.value) == "the query contains a null character"
-        exc = raises(ValueError, cur.execute, "select 2\0")
+        exc = pytest.raises(ValueError, cur.execute, "select 2\0")
         assert str(exc.value) == "the query contains a null character"
 
     def test_close_in_del_ordering(self):


More information about the pypy-commit mailing list