PEP8 fixes for tests

This commit is contained in:
Roman Zeyde
2014-12-27 12:11:51 +02:00
parent f88820e9c3
commit ca93de06af
3 changed files with 4 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ def test_saturation():
except common.SaturationError as e:
assert e.args == (max(x),)
def test_izip():
x = range(10)
y = range(-10, 0)

View File

@@ -7,6 +7,7 @@ from amodem import equalizer
from amodem import config
config = config.fastest()
def assert_approx(x, y, e=1e-12):
assert norm(x - y) < e * norm(x)

View File

@@ -34,16 +34,17 @@ def test_main(data):
decoded = framing.decode(encoded)
assert bytearray(decoded) == data
def test_fail():
encoded = list(framing.encode(''))
encoded[-1] = not encoded[-1]
with pytest.raises(ValueError):
list(framing.decode(encoded))
def test_missing():
f = framing.Framer()
with pytest.raises(ValueError):
list(f.decode(b'\x00'))
with pytest.raises(ValueError):
list(f.decode(b'\x01\x02\x03\x04'))