Skip to content

Commit

Permalink
Basic import testing
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 4, 2024
1 parent 9f770a1 commit ffd69e7
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ jobs:
run: |
pip install --upgrade wheel pip setuptools
pip install .
- name: Test with pytest
run: |
pip install pytest pytest-mock pytest-cov
pytest tests/
185 changes: 184 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ ipython = ">=7.9.0"
flake8 = ">=3.7.9"
doc8 = ">=0.8.0"
ipdb = ">=0.12.3"
pytest = ">=5.2.2"
pytest-cov = ">=2.8.1"
pytest-mock = ">=1.13.0"
pytest-sugar = ">=0.9.2"
coverage = {version = ">=5.0", extras = ["toml"]}
nox = ">=2021.6.12"
ruff = ">=0.5.0"
Sphinx = ">=4.0.0"
Expand Down Expand Up @@ -81,6 +86,23 @@ section-order = ["future", "standard-library", "typing", "third-party", "sdss",
typing = ["typing"]
sdss = ["sdsstools", "sdssdb"]

[tool.pytest.ini_options]
addopts = "--cov target_selection --cov-report xml --cov-report html --cov-report term -W ignore"

[tool.coverage.run]
branch = true
include = ["python/target_selection/*"]
omit = [
"**/__init__.py",
"**/__main__.py",
]

[tool.coverage.report]
exclude_lines = [
"if TYPE_CHECKING:",
"# pragma: no cover"
]

[build-system]
requires = ["poetry-core>=1.1.0"]
build-backend = "poetry.core.masonry.api"
15 changes: 15 additions & 0 deletions tests/test_target_selection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: José Sánchez-Gallego ([email protected])
# @Date: 2024-07-03
# @Filename: test_target_selection.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)

from __future__ import annotations


def test_target_selection_import():
from target_selection.cartons import BaseCarton

assert BaseCarton is not None

0 comments on commit ffd69e7

Please sign in to comment.