You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I'm not sure whether macOS or zsh is at fault here, but if you run tox on macOS, the test_shell_error() test fails to match the regex:
tox -e py311-dj41-sqlite
# snip
.tox/py311-dj41-sqlite/lib/python3.11/site-packages/django_migrations_ci/shell.py:23: MigrateCIShellException
During handling of the above exception, another exception occurred:
def test_shell_error():
> with pytest.raises(shell.MigrateCIShellException, match="/bin/sh: 1: oof: not found\n"):
E AssertionError: Regex pattern did not match.
E Regex: '/bin/sh: 1: oof: not found\n'
E Input: '/bin/sh: oof: command not found\n'
tests/test_shell.py:12: AssertionError
Here's what I believe will fix it:
diff --git a/tests/test_shell.py b/tests/test_shell.py
index 56a14c7..d3a0765 100644
--- a/tests/test_shell.py+++ b/tests/test_shell.py@@ -9,7 +9,10 @@ def test_shell_ok():
def test_shell_error():
- with pytest.raises(shell.MigrateCIShellException, match="/bin/sh: 1: oof: not found\n"):+ with pytest.raises(+ shell.MigrateCIShellException,+ match=r"/bin/sh: (1: )?oof: (command )?not found\n",+ ):
shell.exec("oof")
If you think this is worth adding in, I'm happy to throw up a quick PR.
The text was updated successfully, but these errors were encountered:
Fixesbusinho#45 because the default shell on macOS returns
`/bin/sh: oof: command not found\n` which doesn't quite match the
regex provided.
After discussion with @iurisilvio, using a fairly lax regex which
just looks for "oof" followed by "not found" is good enough.
Fixes#45 because the default shell on macOS returns
`/bin/sh: oof: command not found\n` which doesn't quite match the
regex provided.
After discussion with @iurisilvio, using a fairly lax regex which
just looks for "oof" followed by "not found" is good enough.
Hey, I'm not sure whether macOS or zsh is at fault here, but if you run tox on macOS, the
test_shell_error()
test fails to match the regex:Here's what I believe will fix it:
If you think this is worth adding in, I'm happy to throw up a quick PR.
The text was updated successfully, but these errors were encountered: