diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c92b066..117c462 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -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 diff --git a/tests/test_precommit.py b/tests/test_precommit.py index eb33433..da8b4a8 100644 --- a/tests/test_precommit.py +++ b/tests/test_precommit.py @@ -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 @@ -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