summaryrefslogtreecommitdiff
path: root/test/integration/targets/ansible-test-units-assertions/runme.sh
blob: 86fe5c818112f7e4ee9437648370b6932a0cc6f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash

source ../collection/setup.sh

set -x

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 --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$" pytest.log
  else

    grep "^E  *AssertionError: assert {'yes': True} == {'no': False}$" pytest.log
  fi
done