diff --git a/tests/test_tickets.py b/tests/test_tickets.py
index 0c4af110e16b9af93bca7d7fdef9edc1bcdd7680..ba301378a0cacc50164bf8543a2ef5a6653a8190 100644
--- a/tests/test_tickets.py
+++ b/tests/test_tickets.py
@@ -584,7 +584,7 @@ def test_ticket_39():
 
     scratch = os.path.realpath(db.get_config().get(
         "EndToEndTests", "test_tickets.test_ticket_39.scratch"))
-    assert_true(os.path.isdir(scratch))
+    assert os.path.isdir(scratch)
     testfile = os.path.join(scratch, "test.dat")
     try:
         # insert RecordType
@@ -595,19 +595,16 @@ def test_ticket_39():
         # check if the server can connect to this filesystem
 
         f = db.File(path="testfiles/file1", pickup=testfile).insert()
-        assert_true(f.is_valid())
+        assert f.is_valid()
         f.delete()
 
         # make unreadable
         os.chmod(testfile, 0o000)
-        try:
+        with pytest.raises(TransactionError) as te:
             f = db.File(
                 path="testfiles/file1", pickup=testfile).insert()
-        except EntityError as e:
-            assert_equal(
-                "Insufficient read permission for this file. "
-                "Please make it readable.",
-                e.msg)
+        e = te.value.get_errors()[0]
+        assert e.msg == "Insufficient read permission for this file. Please make it readable."
 
     finally:
         os.chmod(testfile, 0o600)
@@ -625,7 +622,7 @@ def test_ticket_128():
     try:
         db.execute_query(r"FIND 5\#):xw;;-`;BY6~PjsI^*g.$+eY#n.aA9zm")
     except TransactionError as e:
-        assert_equal(13, int(e.get_error().code))
+        assert 13 == int(e.get_error().code)
 
 
 def test_ticket_123a():