Skip to content

Commit

Permalink
Fix ansible#80020 typos confusing pylint for pytest (ansible#80056)
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz authored Feb 21, 2023
1 parent ecf66c6 commit c05d813
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bugfixes:
- ansible-test - Add support for ``pylint`` assertion rewriting when running unit tests on Python 3.5 and later.
- ansible-test - Add support for ``pytest`` assertion rewriting when running unit tests on Python 3.5 and later.
Resolves issue https://github.com/ansible/ansible/issues/68032
known_issues:
- ansible-test - Unit tests for collections do not support ``pylint`` assertion rewriting on Python 2.7.
- ansible-test - Unit tests for collections do not support ``pytest`` assertion rewriting on Python 2.7.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ options=$("${TEST_DIR}"/../ansible-test/venv-pythons.py --only-versions)
IFS=', ' read -r -a pythons <<< "${options}"

for python in "${pythons[@]}"; do
if ansible-test units --color --truncate 0 --python "${python}" --requirements "${@}" 2>&1 | tee pylint.log; then
if ansible-test units --color --truncate 0 --python "${python}" --requirements "${@}" 2>&1 | tee pytest.log; then
echo "Test did not fail as expected."
exit 1
fi

if [ "${python}" = "2.7" ]; then
grep "^E *AssertionError$" pylint.log
grep "^E *AssertionError$" pytest.log
else

grep "^E *AssertionError: assert {'yes': True} == {'no': False}$" pylint.log
grep "^E *AssertionError: assert {'yes': True} == {'no': False}$" pytest.log
fi
done
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def collection_pypkgpath(self):

def enable_assertion_rewriting_hook(): # type: () -> None
"""
Enable pylint's AssertionRewritingHook on Python 3.x.
This is necessary because the Ansible collection loader intercepts imports before the pylint provided loader ever sees them.
Enable pytest's AssertionRewritingHook on Python 3.x.
This is necessary because the Ansible collection loader intercepts imports before the pytest provided loader ever sees them.
"""
import sys

Expand Down

0 comments on commit c05d813

Please sign in to comment.