Skip to content

Commit

Permalink
tests: add example test
Browse files Browse the repository at this point in the history
  • Loading branch information
timurbazhirov committed Dec 13, 2024
1 parent 3a74521 commit 5f8e868
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: ./actions/py/pytest
with:
python-version: ${{ matrix.python-version }}
unit-test-directory: ./
unit-test-directory: tests/

publish-py-package:
needs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
.python-version
6 changes: 3 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Accordingly, the packages are installed using the kernel type, e.g., packages_pyodide.
# The default packages are installed for all the notebooks.
default:
packages_common:
packages_python:
packages_pyodide:
packages_common: []
packages_python: []
packages_pyodide: []
notebooks:
- name: validate_data.ipynb
packages_common:
Expand Down
15 changes: 12 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
# "pydantic", # included in mat3ra-esse[dev]
# "jsonschema",
# specific requirements
"mat3ra-utils[jupyter]",
"mat3ra-utils[jupyterlite]",
]

[project.optional-dependencies]
Expand All @@ -36,6 +36,7 @@ tests = [
"pytest",
"pytest-cov",
"pytest-mock",
"pytest-asyncio",
]
all = ["camsai-notebooks[tests]"]

Expand All @@ -55,7 +56,11 @@ build-backend = "setuptools.build_meta"
git_describe_command = "git describe --tags --long"

[tool.setuptools.packages.find]
where = ["utils"]
where = ["src"]

[tool.setuptools.package-data]
src = ["config.yml"]


[tool.black]
line-length = 120
Expand All @@ -74,7 +79,7 @@ extend-exclude = [
"src/js"
]
line-length = 120
target-version = "py38"
target-version = "py310"

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
Expand All @@ -83,3 +88,7 @@ target-version = "py38"
profile = "black"
multi_line_output = 3
include_trailing_comma = true

# to avoid `warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))`
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
Empty file added src/__init__.py
Empty file.
Empty file added src/camsai/__init__.py
Empty file.
Empty file.
1 change: 1 addition & 0 deletions src/camsai/notebooks/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from mat3ra.utils.jupyterlite.packages import install_packages
7 changes: 7 additions & 0 deletions tests/test_install_packages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest
from camsai.notebooks.utils import install_packages

@pytest.mark.asyncio
async def test_install_packages():
await install_packages("validate_data.ipynb", "./config.yml")
assert True
1 change: 0 additions & 1 deletion utils/__init__.py

This file was deleted.

0 comments on commit 5f8e868

Please sign in to comment.