mirror of
https://github.com/romanz/amodem.git
synced 2026-03-23 19:01:00 +08:00
test receiver timing with pytest fixtures
This commit is contained in:
@@ -13,6 +13,8 @@ import logging
|
|||||||
logging.basicConfig(level=logging.DEBUG,
|
logging.basicConfig(level=logging.DEBUG,
|
||||||
format='%(asctime)s %(levelname)-12s %(message)s')
|
format='%(asctime)s %(levelname)-12s %(message)s')
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
class Args(object):
|
class Args(object):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
@@ -56,10 +58,13 @@ def test_error():
|
|||||||
run(1024, chan=lambda x: x[:-skip], success=False)
|
run(1024, chan=lambda x: x[:-skip], success=False)
|
||||||
|
|
||||||
|
|
||||||
def test_frequency_error():
|
@pytest.fixture(params=[s*x for s in (+1, -1) for x in (0.1, 1, 10)])
|
||||||
for ppm in [0.1, 1, 10]:
|
def freq_err(request):
|
||||||
for sign in [+1, -1]:
|
return request.param * 1e-6
|
||||||
run(1024, df=sign*ppm*1e-6)
|
|
||||||
|
|
||||||
|
def test_timing(freq_err):
|
||||||
|
run(1024, df=freq_err)
|
||||||
|
|
||||||
|
|
||||||
def test_lowpass():
|
def test_lowpass():
|
||||||
|
|||||||
Reference in New Issue
Block a user