From 7864332ef2a7ffd2fe0007789ac4fa5f8bd01249 Mon Sep 17 00:00:00 2001 From: Neil Shephard Date: Wed, 11 Dec 2024 15:30:17 +0000 Subject: [PATCH] ci: Adds pytest-testmon to local pre-commit hooks Closes #88 Also adds a few more things to `.gitignore`. --- .gitignore | 8 ++++++++ .pre-commit-config.yaml | 8 ++++++++ pyproject.toml | 1 + 3 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index 8b71906..071f446 100644 --- a/.gitignore +++ b/.gitignore @@ -139,5 +139,13 @@ _version.py # Ignore topostats/_version.py as per setuptools_scm AFMReader/_version.py +# Emacs +\#* +*~ +.dir-locals.el + +# Pytest-testmon files +.testmon* + # Ignore tmp/ directory tmp/ \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27e4371..7e2a75d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,6 +65,14 @@ repos: language: system files: \.py$ + - repo: local + hooks: + - id: pytest + name: Pytest (testmon) + entry: pytest --testmon + language: system + files: \.py$ + ci: autofix_prs: true autofix_commit_msg: '[pre-commit.ci] Fixing issues with pre-commit' diff --git a/pyproject.toml b/pyproject.toml index 7f62cf5..e88fa66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ dev = [ "black", "pre-commit", "pylint", + "pytest-testmon", "ruff", "setuptools_scm[toml]", "wheel"