Skip to content
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
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ dev = [
"pre-commit>=4.2.0",
"ruff>=0.11.4",
"pytest>=7.0",
"pytest-profiling",
"flameprof",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
addopts = "-v"
addopts = "-v -m 'not profiling'"
3 changes: 2 additions & 1 deletion src/dementpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ def main():
os.chdir('../'+output_folder)
export(Output_init, site, outname)

main()
if __name__ == '__main__':
main()
18 changes: 18 additions & 0 deletions tests/profiling/test_profiling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Test(s) to use with pytest-profiling to identify bottlenecks in the code."""
import pytest

@pytest.mark.profiling
def test_profiling(monkeypatch):

# Define the command line arguments
import sys
argv = ['dementpy.py', 'grassland', 'output', '20250402', 'scrubland']
monkeypatch.setattr(sys, 'argv', argv)

# Move to subfolder so input and output folders will be correct
import os
os.chdir('src')

# Run dementpy
import dementpy
dementpy.main()
File renamed without changes.
File renamed without changes.
File renamed without changes.