Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:allianz-direct/precommit_nbconvert_…
Browse files Browse the repository at this point in the history
…rename into main
  • Loading branch information
timvink committed Jan 20, 2022
2 parents e169c79 + 4915777 commit 2061827
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
name: Unit tests
on:
push:
branches:
- main
pull_request:
branches:
- main
on: [push, pull_request]
jobs:
run:
name: Run unit tests
Expand Down
6 changes: 3 additions & 3 deletions tests/test_precommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ def test_precommit_hook(tmp_path):
# First pass pre-commit. Will output something like:
# nb_prep (pre-commit; process notebooks)..................................Failed
# - hook id: nb_prep_precommit
out = shell_output(f"pre-commit try-repo {current_dir} --verbose")
out = shell_output(f"pre-commit try-repo '{current_dir}' --verbose")
assert "nb_prep (pre-commit; process notebooks).." in out
assert "...Failed" in out

# Add changes
repo.git.add(all=True)
# Second pass should succeed
out = shell_output(f"pre-commit try-repo {current_dir} --verbose")
out = shell_output(f"pre-commit try-repo '{current_dir}' --verbose")
assert "nb_prep (pre-commit; process notebooks).." in out
assert "...Passed" in out

Expand All @@ -82,6 +82,6 @@ def test_precommit_hook(tmp_path):
repo.git.add(all=True)
repo.git.commit(message="add stuff", author=author)

out = shell_output(f"pre-commit try-repo {current_dir} --verbose --hook-stage post-commit")
out = shell_output(f"pre-commit try-repo '{current_dir}' --verbose --hook-stage post-commit")
assert "nb_prep (post-commit; replace hash placeholder in .html filenames)...." in out
assert "...Passed" in out

0 comments on commit 2061827

Please sign in to comment.