Skip to content

Commit

Permalink
tests: dont crash all tests just because PyDaqmx doesnt work on linux
Browse files Browse the repository at this point in the history
see #13
  • Loading branch information
nzjrs committed May 17, 2021
1 parent 95a4e9a commit 256ab9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ def _has_soundcard():

def _has_daq(name=''):
import ctypes
import PyDAQmx as daq
try:
import PyDAQmx as daq
except NotImplementedError:
# we are running on linux...
return False

buff = ctypes.create_string_buffer(1024)
# noinspection PyUnresolvedReferences
Expand Down
3 changes: 2 additions & 1 deletion tests/test_daq.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest

from flyvr.audio.io_task import IOTask, DAQ_NUM_OUTPUT_SAMPLES, DAQ_NUM_OUTPUT_SAMPLES_PER_EVENT
from flyvr.common import SharedState
from flyvr.common.logger import DatasetLogServer
from flyvr.audio.signal_producer import SampleChunk
Expand All @@ -12,6 +11,8 @@ def test_io_a_output(tmpdir):

import h5py

from flyvr.audio.io_task import IOTask, DAQ_NUM_OUTPUT_SAMPLES, DAQ_NUM_OUTPUT_SAMPLES_PER_EVENT

with DatasetLogServer() as log_server:

shared_state = SharedState(None, logger=log_server.start_logging_server(tmpdir.join('test.h5').strpath))
Expand Down

0 comments on commit 256ab9f

Please sign in to comment.