Skip to content

Commit

Permalink
Merge pull request #4 from HRosete/ad9371_test
Browse files Browse the repository at this point in the history
Added patch for OBS channel support (c/o Travis)
  • Loading branch information
HRosete authored Apr 20, 2021
2 parents 9cdd15b + 670286c commit 927fe17
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
18 changes: 18 additions & 0 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ def pytest_collection_modifyitems(items):
break


def pytest_addoption(parser):
parser.addoption(
"--obs-enable",
action="store_true",
help="Run tests that use observation data paths",
)


def pytest_runtest_setup(item):
# Handle observation based devices
obs = item.config.getoption("--obs-enable")
marks = [mark.name for mark in item.iter_markers()]
if not obs and "obs_required" in marks:
pytest.skip(
"Testing requiring observation disabled. Use --obs-enable flag to enable"
)


#################################################
def dev_interface(uri, classname, val, attr, tol):
sdr = eval(classname + "(uri='" + uri + "')")
Expand Down
8 changes: 7 additions & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
import test.rf.spec as spec
import time
from test.attr_tests import *
from test.common import dev_interface, pytest_collection_modifyitems, pytest_configure
from test.common import (
dev_interface,
pytest_collection_modifyitems,
pytest_configure,
pytest_runtest_setup,
pytest_addoption,
)
from test.dma_tests import *
from test.generics import iio_attribute_single_value
from test.globals import *
Expand Down

0 comments on commit 927fe17

Please sign in to comment.