Skip to content

Commit 0f23bcc

Browse files
committed
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.
1 parent 3c025a9 commit 0f23bcc

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ matrix:
2929
python: "2.7"
3030
dist: trusty # trusty required for 2.7
3131
install:
32+
- bash ./kill_python3_tests.sh
3233
- pip install -U pip setuptools
3334
- pip install -Ur requirements-test.txt --upgrade-strategy eager
3435
script: py.test tests/ -v --cov wrapanapi

kill_python3_tests.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
BLACKLISTED_TEST_FILES=test_redfish.py
4+
5+
PYTHON_VERSION=$(python -c 'import sys ; print("%d%d"%sys.version_info[0:2])')
6+
7+
echo "Python at version $PYTHON_VERSION"
8+
if (( "$PYTHON_VERSION" < "36" ))
9+
then
10+
echo "Blacklisting files that require at least Python 3.6"
11+
for F in $BLACKLISTED_TEST_FILES
12+
do
13+
echo "tests/$F"
14+
[[ -f "tests/$F" ]] && mv "tests/$F" "tests/$F.disable"
15+
done
16+
fi

0 commit comments

Comments
 (0)