Skip to content

Commit

Permalink
Merge pull request #50 from bernardosabatinilab/dev
Browse files Browse the repository at this point in the history
adding importing tests
  • Loading branch information
jbwallace123 authored Jan 24, 2024
2 parents 260c321 + ed848e9 commit 925a9b6
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/installation_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build

on:
push:
branches: [ "main"]
branches: [ "main" ]
pull_request:
branches: [ "main", "dev" ]
workflow_dispatch:
Expand Down Expand Up @@ -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",
]
Expand Down Expand Up @@ -131,3 +131,8 @@ jobs:
run: |
pip list
conda list
- name: Run pytest
run: |
pip install pytest
python -m pytest --capture=tee-sys
55 changes: 55 additions & 0 deletions tests/test_import.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 925a9b6

Please sign in to comment.