test receiver timing with pytest fixtures

This commit is contained in:
Roman Zeyde
2014-08-30 12:40:57 +03:00
parent 57b9ebca51
commit 85d8a77fb5

View File

@@ -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():