tox: add optional database testenv
@@ -27,20 +27,6 @@ deps =
-rtest_requirements.txt
-roptional_requirements.txt
-[testenv:remote]
-# Create test containers with the following commands:
-# docker run -it --name samba -p 139:139 -p 445:445 -d "dperson/samba" -p -u "user1;pass1" -s "public;/public-dir;yes;no;yes;all"
-# docker run -it --name sftp -p 22:22 -d atmoz/sftp user2:pass2:::public
-setenv =
- {[testenv]setenv}
- PETL_TEST_SMB=smb://WORKGROUP;user1:pass1@localhost/public/
- PETL_TEST_SFTP=sftp://user1:pass1@localhost/public/
-commands =
- nosetests -v petl --with-coverage --cover-package=petl
-deps =
- {[testenv]deps}
- -rremotes_requirements.txt
-
[testenv:{py37,py38,py39}-docs]
# build documentation under similar environment to readthedocs
changedir = docs
@@ -60,6 +46,36 @@ deps =
commands =
sphinx-build -W -b singlehtml -d {envtmpdir}/doctrees . _build/singlehtml
+[testenv:remote]
+# Create test containers with the following commands:
+# docker run -it --name samba -p 139:139 -p 445:445 -d "dperson/samba" -p -u "user1;pass1" -s "public;/public-dir;yes;no;yes;all"
+# docker run -it --name sftp -p 22:22 -d atmoz/sftp user2:pass2:::public
+setenv =
+ {[testenv]setenv}
+ PETL_TEST_SMB=smb://WORKGROUP;user1:pass1@localhost/public/
+ PETL_TEST_SFTP=sftp://user1:pass1@localhost/public/
+commands =
+ nosetests -v petl --with-coverage --cover-package=petl
+deps =
+ {[testenv]deps}
+ -rremotes_requirements.txt
+
+[testenv:database]
+# Create test containers with the following commands:
+# docker run -it --name mysql -p 3306:3306 -p 33060:33060 -e MYSQL_ROOT_PASSWORD=pass0 -e MYSQL_DATABASE=petl -e MYSQL_USER=petl -e MYSQL_PASSWORD=test -d mysql:latest
+# docker run -it --name postgres -p 5432:5432 -e POSTGRES_DB=petl -e POSTGRES_USER=petl -e POSTGRES_PASSWORD=test -d postgres:latest
+setenv =
+ {[testenv]setenv}
+commands =
+ nosetests -v petl --with-coverage --cover-package=petl
+deps =
+ cryptography
+ pymysql
+ SQLAlchemy
+ psycopg2-binary
+ # mysqlclient
+ -rtest_requirements.txt
+
[testenv:mysqldb]
basepython = python2.7
setenv =
