Skip to content

Commit

Permalink
Add travis steps to remove Python 3+ tests
Browse files Browse the repository at this point in the history
The Redfish tests are Python 3 only. With this change we remove
the tests if running in anything less than Python 3.6.
  • Loading branch information
matejart committed Aug 28, 2019
1 parent 3c025a9 commit 55025d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions kill_python3_tests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 55025d1

Please sign in to comment.