diff options
author | Joris Roovers <joris.roovers@gmail.com> | 2022-07-14 12:42:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-14 12:42:42 +0200 |
commit | 4f512c78f6c119b6387e7e7dc8fa79d987b6380d (patch) | |
tree | f6f6aba3cc8ae7e58b546372048c735d0dc6c213 /qa | |
parent | 63500a584473565451064ac751024691c40d4b95 (diff) |
github CI fix: no tty attached to stdin (#304)
Dynamically patch the commit-msg hook using sed to fix integration test failures
related to gitlint output colorization.
Fixes #298
Diffstat (limited to 'qa')
-rw-r--r-- | qa/test_hooks.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/qa/test_hooks.py b/qa/test_hooks.py index b78100e..c8cc630 100644 --- a/qa/test_hooks.py +++ b/qa/test_hooks.py @@ -67,7 +67,8 @@ class HookTests(BaseTestCase): f"[master {short_hash}] This ïs a title\n", " 1 file changed, 0 insertions(+), 0 deletions(-)\n", f" create mode 100644 {test_filename}\n"] - self.assertListEqual(expected_output, self.githook_output) + for output, expected in zip(self.githook_output, expected_output): + self.assertMultiLineEqual(output.replace('\r', ''), expected.replace('\r', '')) def test_commit_hook_continue(self): self.responses = ["y"] @@ -84,11 +85,8 @@ class HookTests(BaseTestCase): " 1 file changed, 0 insertions(+), 0 deletions(-)\n", f" create mode 100644 {test_filename}\n"] - assert len(self.githook_output) == len(expected_output) for output, expected in zip(self.githook_output, expected_output): - self.assertMultiLineEqual( - output.replace('\r', ''), - expected.replace('\r', '')) + self.assertMultiLineEqual(output.replace('\r', ''), expected.replace('\r', '')) def test_commit_hook_abort(self): self.responses = ["n"] @@ -108,7 +106,8 @@ class HookTests(BaseTestCase): "Contënt on the second line\n", "-----------------------------------------------\n"] - self.assertListEqual(expected_output, self.githook_output) + for output, expected in zip(self.githook_output, expected_output): + self.assertMultiLineEqual(output.replace('\r', ''), expected.replace('\r', '')) def test_commit_hook_edit(self): self.responses = ["e", "y"] @@ -131,11 +130,8 @@ class HookTests(BaseTestCase): " 1 file changed, 0 insertions(+), 0 deletions(-)\n", f" create mode 100644 {test_filename}\n"] - assert len(self.githook_output) == len(expected_output) for output, expected in zip(self.githook_output, expected_output): - self.assertMultiLineEqual( - output.replace('\r', ''), - expected.replace('\r', '')) + self.assertMultiLineEqual(output.replace('\r', ''), expected.replace('\r', '')) def test_commit_hook_worktree(self): """ Tests that hook installation and un-installation also work in git worktrees. |