From 6af8760bceef455e8e2c9eae6f482d4825fa4903 Mon Sep 17 00:00:00 2001 From: Robert Cudmore Date: Thu, 23 Nov 2023 10:02:17 -0800 Subject: [PATCH] improving qt tests --- .github/workflows/tests.yml | 2 +- sanpy/interface/sanpy_app.py | 1 + tests/interface/test_plugins.py | 33 +++++++++++++++++---------------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e9cfa32d..1a64b661 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,7 +50,7 @@ jobs: run: | # ignore /interface tests, they are running out of memory on github? pytest --cov=./tests --cov-report=xml --ignore=./tests/interface ./tests - pytest --cov=./tests --cov-report=xml ./tests/interface + pytest -s --cov=./tests --cov-report=xml ./tests/interface - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 \ No newline at end of file diff --git a/sanpy/interface/sanpy_app.py b/sanpy/interface/sanpy_app.py index 1238ee82..0ea54236 100644 --- a/sanpy/interface/sanpy_app.py +++ b/sanpy/interface/sanpy_app.py @@ -1,6 +1,7 @@ # Author: Robert H Cudmore # Date: 20190719 +# see: https://stackoverflow.com/questions/63871662/python-multiprocessing-freeze-support-error from multiprocessing import freeze_support freeze_support() diff --git a/tests/interface/test_plugins.py b/tests/interface/test_plugins.py index d32d44f4..da91ff09 100644 --- a/tests/interface/test_plugins.py +++ b/tests/interface/test_plugins.py @@ -154,21 +154,22 @@ def test_plugins(qtbot): _pluginList = pluginsObject.pluginList() assert len(_pluginList) > 0 - # (2) ba loaded but no analysis - # path = 'data/19114001.abf' - path = os.path.join('data', '19114001.abf') - baNoAnalysis = sanpy.bAnalysis(path) - - # (3) ba loaded and with analysis - baWithAnalysis = sanpy.bAnalysis(path) - bd = sanpy.bDetection() # gets default - dDict = bd.getDetectionDict('SA Node') - baWithAnalysis.spikeDetect(dDict) - - pathSweeps = os.path.join('data', '2021_07_20_0010.abf') - baSweeps = sanpy.bAnalysis(pathSweeps) - dDict = bd.getDetectionDict('Fast Neuron') - baSweeps.spikeDetect(dDict) + if 0: + # (2) ba loaded but no analysis + # path = 'data/19114001.abf' + path = os.path.join('data', '19114001.abf') + baNoAnalysis = sanpy.bAnalysis(path) + + # (3) ba loaded and with analysis + baWithAnalysis = sanpy.bAnalysis(path) + bd = sanpy.bDetection() # gets default + dDict = bd.getDetectionDict('SA Node') + baWithAnalysis.spikeDetect(dDict) + + pathSweeps = os.path.join('data', '2021_07_20_0010.abf') + baSweeps = sanpy.bAnalysis(pathSweeps) + dDict = bd.getDetectionDict('Fast Neuron') + baSweeps.spikeDetect(dDict) # github workflow is running out of memory @@ -176,7 +177,7 @@ def test_plugins(qtbot): for _pluginNumber, _pluginName in enumerate(_pluginList): continue - + if _pluginName != 'Plot Scatter': continue