Debian Codegraph @

test/integration/targets/ansible-test-units-assertions/runme.sh

raw
1 #!/usr/bin/env bash
2
3 source ../collection/setup.sh
4
5 set -x
6
7 options=$("${TEST_DIR}"/../ansible-test/venv-pythons.py --only-versions)
8 IFS=', ' read -r -a pythons <<< "${options}"
9
10 for python in "${pythons[@]}"; do
11 if ansible-test units --truncate 0 --python "${python}" --requirements "${@}" 2>&1 | tee pytest.log; then
12 echo "Test did not fail as expected."
13 exit 1
14 fi
15
16 if [ "${python}" = "2.7" ]; then
17 grep "^E *AssertionError$" pytest.log
18 else
19
20 grep "^E *AssertionError: assert {'yes': True} == {'no': False}$" pytest.log
21 fi
22 done