From: Philipp Gesang Date: Mon, 8 May 2017 07:58:33 +0000 (+0200) Subject: remove pytest dependency from test_crypto.py X-Git-Tag: v2.2~7^2~124 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=97ba515a38379a03abaa39791b323be739e6acaa;p=python-delta-tar remove pytest dependency from test_crypto.py --- diff --git a/testing/test_crypto.py b/testing/test_crypto.py index cfb332c..98100a8 100644 --- a/testing/test_crypto.py +++ b/testing/test_crypto.py @@ -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