remove pytest dependency from test_crypto.py
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 8 May 2017 07:58:33 +0000 (09:58 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 2 Apr 2018 11:34:08 +0000 (13:34 +0200)
testing/test_crypto.py

index cfb332c..98100a8 100644 (file)
@@ -1,7 +1,6 @@
 import binascii
 import os
 import pylibscrypt
-import pytest
 import struct
 import unittest
 
@@ -329,8 +328,10 @@ class HeaderTest (CryptoLayerTest):
         assert ok is True
         assert hdr is not None
         hdr += b"-junk"
-        with pytest.raises (crypto.InvalidHeader):
+        try:
             _ = crypto.hdr_read (hdr)
+        except crypto.InvalidHeader:
+            pass
 
 
     def test_crypto_fmt_hdr_read_leading_garbage (self):
@@ -340,8 +341,10 @@ class HeaderTest (CryptoLayerTest):
         assert ok is True
         assert hdr is not None
         hdr = b"junk-" + hdr
-        with pytest.raises (crypto.InvalidHeader):
+        try:
             _ = crypto.hdr_read (hdr)
+        except crypto.InvalidHeader:
+            pass
 
 
     def test_crypto_fmt_hdr_inner_garbage (self):
@@ -349,7 +352,8 @@ class HeaderTest (CryptoLayerTest):
         ok, hdr = crypto.hdr_make (meta)
         assert ok
         data = hdr[:len(hdr)//2] + b"junk-" + hdr[len(hdr)//2:]
-        with pytest.raises (crypto.InvalidHeader):
+        try:
             _ = crypto.hdr_read (data)
-
+        except crypto.InvalidHeader:
+            pass