Use travis test config variable 0/1 instead of blank strings

Travis web interface doesn't allow anymore to set an empty string as
variable value.
This commit is contained in:
Daniele Varrazzo 2019-10-19 14:49:27 +02:00
parent 58654990d6
commit 8f11821c17
4 changed files with 9 additions and 9 deletions

View File

@ -16,7 +16,7 @@ How to make a psycopg2 release
$ export VERSION=2.7
- In the `Travis settings`__ you may want to be sure that the variables
``TEST_PAST`` and ``TEST_FUTURE`` are set to a nonzero string to check all
``TEST_PAST`` and ``TEST_FUTURE`` are set to 1 to check all
the supported postgres version.
.. __: https://travis-ci.org/psycopg/psycopg2/settings

View File

@ -116,7 +116,7 @@ create () {
cd /
# Postgres versions supported by Travis CI
if [[ -z "$DONT_TEST_PRESENT" ]]; then
if (( ! "$DONT_TEST_PRESENT" )); then
create 10
create 9.6
create 9.5
@ -125,7 +125,7 @@ fi
# Unsupported postgres versions that we still support
# Images built by https://github.com/psycopg/psycopg2-wheels/tree/build-dinosaurs
if [[ -n "$TEST_PAST" ]]; then
if (( "$TEST_PAST" )); then
create 7.4
create 8.0
create 8.1
@ -139,6 +139,6 @@ if [[ -n "$TEST_PAST" ]]; then
fi
# Postgres built from master
if [[ -n "$TEST_FUTURE" ]]; then
if (( "$TEST_FUTURE" )); then
create 11 11-master
fi

View File

@ -16,7 +16,7 @@ set -e -x
run_test () {
VERSION=$1
DBNAME=psycopg2_test
if [[ -n "$TEST_VERBOSE" ]]; then
if (( "$TEST_VERBOSE" )); then
VERBOSE=--verbose
else
VERBOSE=
@ -45,7 +45,7 @@ run_test () {
}
# Postgres versions supported by Travis CI
if [[ -z "$DONT_TEST_PRESENT" ]]; then
if (( ! "$DONT_TEST_PRESENT" )); then
run_test 10
run_test 9.6
run_test 9.5
@ -54,7 +54,7 @@ fi
# Unsupported postgres versions that we still support
# Images built by https://github.com/psycopg/psycopg2-wheels/tree/build-dinosaurs
if [[ -n "$TEST_PAST" ]]; then
if (( "$TEST_PAST" )); then
run_test 9.3
run_test 9.2
run_test 9.1
@ -68,6 +68,6 @@ if [[ -n "$TEST_PAST" ]]; then
fi
# Postgres built from master
if [[ -n "$TEST_FUTURE" ]]; then
if (( "$TEST_FUTURE" )); then
run_test 11
fi

View File

@ -425,7 +425,7 @@ def slow(f):
"""
@wraps(f)
def slow_(self):
if os.environ.get('PSYCOPG2_TEST_FAST'):
if os.environ.get('PSYCOPG2_TEST_FAST', '0') != '0':
return self.skipTest("slow test")
return f(self)
return slow_