From 55025d1002f698d8750cb0c13bd3f885a0fcf9b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Arta=C4=8D?= Date: Wed, 28 Aug 2019 13:05:39 +0200 Subject: [PATCH] Add travis steps to remove Python 3+ tests The Redfish tests are Python 3 only. With this change we remove the tests if running in anything less than Python 3.6. --- .travis.yml | 1 + kill_python3_tests.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 kill_python3_tests.sh diff --git a/.travis.yml b/.travis.yml index 950a0cfd..ef872dfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ matrix: python: "2.7" dist: trusty # trusty required for 2.7 install: + - ./kill_python3_tests.sh - pip install -U pip setuptools - pip install -Ur requirements-test.txt --upgrade-strategy eager script: py.test tests/ -v --cov wrapanapi diff --git a/kill_python3_tests.sh b/kill_python3_tests.sh new file mode 100644 index 00000000..c34a860a --- /dev/null +++ b/kill_python3_tests.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +BLACKLISTED_TEST_FILES=test_redfish.py + +PYTHON_VERSION=$(python -c 'import sys ; print("%d%d"%sys.version_info[0:2])') + +echo "Python at version $PYTHON_VERSION" +if (( "$PYTHON_VERSION" < "36" )) +then + echo "Blacklisting files that require at least Python 3.6" + for F in $BLACKLISTED_TEST_FILES + do + echo "tests/$F" + [[ -f "tests/$F" ]] && mv "tests/$F" "tests/$F.disable" + done +fi