diff --git a/.github/workflows/installation_test.yml b/.github/workflows/installation_test.yml index a836e44..da6d168 100644 --- a/.github/workflows/installation_test.yml +++ b/.github/workflows/installation_test.yml @@ -2,7 +2,7 @@ name: build on: push: - branches: [ "main"] + branches: [ "main" ] pull_request: branches: [ "main", "dev" ] workflow_dispatch: @@ -32,13 +32,13 @@ jobs: windows-2022, windows-2019, # # macos-latest, - # macos-12.0, + macos-12.0, macos-11.0, # macos-10.15, ] python-version: [ "3.9", - "3.10", + # "3.10", # "3.11", # "3.12", ] @@ -131,3 +131,8 @@ jobs: run: | pip list conda list + + - name: Run pytest + run: | + pip install pytest + python -m pytest --capture=tee-sys diff --git a/tests/test_import.py b/tests/test_import.py new file mode 100644 index 0000000..a202192 --- /dev/null +++ b/tests/test_import.py @@ -0,0 +1,55 @@ +import logging +import importlib + +def test_import(): + + repo_packs = [ + 'pandas', + 'numpy', + 'scipy', + 'sklearn', + 'matplotlib', + 'seaborn', + 'datajoint', + 'tensorflow', + 'pymatreader', + 'tomli', + 'yaml', + 'tdt', + 'deeplabcut', + ] + + for pack in repo_packs: + try: + importlib.import_module(pack) + except ImportError: + logging.warning(f'Could not import {pack}.') + continue + + +def test_workflow_packages(): + try: + importlib.import_module('workflow.utils.demodulation') + except ImportError: + logging.warning('Could not import demod from photometry pipeline.') + pass + +def test_elements_pack(): + element_list = [ + 'element_array_ephys', + 'element_deeplabcut', + 'element_interface', + 'element_calcium_imaging', + 'element_animal', + 'element_lab', + 'element_session', + 'element_event', + ] + + for element in element_list: + try: + importlib.import_module(element) + except ImportError: + logging.warning('Could not import {element}.') + pass +