Files
@ 260a7a01b054
Branch filter:
Location: kallithea/tox.ini
260a7a01b054
2.6 KiB
text/x-ini
follow Python conventions for boolean values
True and False might be singletons and the "default" values for "boolean"
expressions, but "all" values in Python has a boolean value and should be
evaluated as such. Checking with 'is True' and 'is False' is thus confusing,
error prone and unnessarily complex.
If we anywhere rely and nullable boolean fields from the database layer and
don't want the null value to be treated as False then we should check
explicitly for null with 'is None'.
True and False might be singletons and the "default" values for "boolean"
expressions, but "all" values in Python has a boolean value and should be
evaluated as such. Checking with 'is True' and 'is False' is thus confusing,
error prone and unnessarily complex.
If we anywhere rely and nullable boolean fields from the database layer and
don't want the null value to be treated as False then we should check
explicitly for null with 'is None'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | [tox]
envlist = py25-sqlite,
py25-mysql,
py25-postgresql,
py26-sqlite,
py26-mysql,
py26-postgresql,
py27-sqlite,
py27-mysql,
py27-postgresql
#### PYTHON 2.5 ####
[testenv:py25-sqlite]
basepython =
python2.5
commands =
nosetests []
setenv =
TEST_DB=sqlite:////tmp/rhodecode_test.sqlite
[testenv:py25-mysql]
basepython =
python2.5
commands =
mysql -uroot -pqwe -hlocalhost -e 'drop database if exists rhodecode_test;'
mysql -uroot -pqwe -hlocalhost -e 'create database rhodecode_test;'
nosetests []
deps =
mysql-python
setenv =
TEST_DB=mysql://root:qwe@localhost/rhodecode_test
[testenv:py25-postgresql]
basepython =
python2.5
commands =
psql -Upostgres -Wqwe -hlocalhost -c 'drop database if exists rhodecode_test;'
psql -Upostgres -Wqwe -hlocalhost -c 'create database rhodecode_test;'
nosetests []
deps =
psycopg2
setenv =
TEST_DB=postgresql://postgres:qwe@localhost/rhodecode_test
#### PYTHON 2.6 ####
[testenv:py26-sqlite]
basepython =
python2.6
commands =
nosetests []
setenv =
TEST_DB=sqlite:////tmp/rhodecode_test.sqlite
[testenv:py26-mysql]
basepython =
python2.6
commands =
mysql -uroot -pqwe -hlocalhost -e 'drop database if exists rhodecode_test;'
mysql -uroot -pqwe -hlocalhost -e 'create database rhodecode_test;'
nosetests []
deps =
mysql-python
setenv =
TEST_DB=mysql://root:qwe@localhost/rhodecode_test
[testenv:py26-postgresql]
basepython =
python2.6
commands =
psql -Upostgres -Wqwe -hlocalhost -c 'drop database if exists rhodecode_test;'
psql -Upostgres -Wqwe -hlocalhost -c 'create database rhodecode_test;'
nosetests []
deps =
psycopg2
setenv =
TEST_DB=postgresql://postgres:qwe@localhost/rhodecode_test
#### PYTHON 2.7 ####
[testenv:py27-sqlite]
basepython =
python2.7
commands =
nosetests []
setenv =
TEST_DB=sqlite:////tmp/rhodecode_test.sqlite
[testenv:py27-mysql]
basepython =
python2.7
commands =
mysql -uroot -pqwe -hlocalhost -e 'drop database if exists rhodecode_test;'
mysql -uroot -pqwe -hlocalhost -e 'create database rhodecode_test;'
nosetests []
deps =
mysql-python
setenv =
TEST_DB=mysql://root:qwe@localhost/rhodecode_test
[testenv:py27-postgresql]
basepython =
python2.7
commands =
psql -Upostgres -Wqwe -hlocalhost -c 'drop database if exists rhodecode_test;'
psql -Upostgres -Wqwe -hlocalhost -c 'create database rhodecode_test;'
nosetests []
deps =
psycopg2
setenv =
TEST_DB=postgresql://postgres:qwe@localhost/rhodecode_test
|