diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 4b1d4fe..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.github/workflows/tomlproject.yml b/.github/workflows/tomlproject.yml index 90875d2..cebbe67 100644 --- a/.github/workflows/tomlproject.yml +++ b/.github/workflows/tomlproject.yml @@ -28,9 +28,11 @@ jobs: # Lint with Ruff # - name: Lint with Ruff # run: | - # ruff check . --statistics # Lint the code using Ruff + # ruff check . --statistics # Run pyest - name: Run Tests run: | - pytest + pytest --cov=pvcircuit + coverage xml + coverage html diff --git a/README.md b/README.md index 00092cf..613df28 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Python Tests](https://github.com/NREL/PVcircuit/actions/workflows/tomlproject.yml/badge.svg?branch=master)](https://github.com/NREL/PVcircuit/actions/workflows/tomlproject.yml) + # pvcircuit *pvcircuit* contains objects that are building blocks for PV modeling and interactive data fitting. diff --git a/pyproject.toml b/pyproject.toml index cea2b5a..2c5a8b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,13 +148,14 @@ dev = [ "check-manifest", "coverage", "pytest", + "pytest-cov", "ruff", - ] test = [ "check-manifest", "coverage", - "pytest" + "pytest", + "pytest-cov", ] # List URLs that are relevant to your project @@ -198,3 +199,22 @@ ignore = [ "F401", # Ignore unused imports # "F841", # Ignore unused variables ] + +[tool.pytest.ini_options] +# Specify directories to ignore during testing +norecursedirs = ["Share", "notebooks", "images", "data"] + +[tool.coverage.run] +branch = true +source = ["pvcircuit"] +omit = [ + "tests/*", + "Share/*", + "notebooks/*", + "images/*", + "data/*", + "pvcircuit/PlotWithControls.py", +] + +[tool.coverage.report] +show_missing = false \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29