Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding importing tests #50

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Loading