Skip to content

Commit

Permalink
Add unit tests to pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Jan 21, 2025
1 parent fd06848 commit aa40564
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
default_install_hook_types: [pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand All @@ -16,3 +17,14 @@ repos:
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: local
hooks:
- id: pytest
name: pytest
entry: pytest
args: [-n, auto, tests/ert/unit_tests, --hypothesis-profile=fast, -m, not integration_test]
language: system
types: [python]
stages: [pre-push]
pass_filenames: false
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ $ pip install pre-commit
$ pre-commit install
```

There is also a pre-push hook configured in `pre-commit` to run a collaction of
relatively fast tests, to install this hook:

```sh
$ pre-commit install --hook-type pre-push
```


### Trouble with setup

As a simple test of your `ert` installation, you may try to run one of the
Expand Down

0 comments on commit aa40564

Please sign in to comment.