]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Add example about running tests in docker
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 9 May 2021 23:46:30 +0000 (01:46 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 9 May 2021 23:46:30 +0000 (01:46 +0200)
Writing it down as I have to hack it together every time.

tests/README.rst

index 030477fe9aa75d799266d45fcb33fd0175ce028e..20e4e2be2af9aefddf3fa7387b327a5ca246c5fb 100644 (file)
@@ -54,3 +54,18 @@ Test options
       ========================= test session starts =========================
       [...]
       ==== 1877 passed, 2 skipped, 169 deselected, 48 xfailed in 13.47s =====
+
+
+Testing in docker
+-----------------
+
+Useful order to test other Python versions without installing them. Can be
+used to replicate GitHub actions failures, specifying a ``--randomly-seed``.
+The following ``PG*`` env vars are an example to adjust the test dsn::
+
+    docker run -ti --rm --volume `pwd`:/src --workdir /src \
+        -e PSYCOPG3_TEST_DSN -e PGHOST=172.17.0.1 -e PGUSER=`whoami` \
+        python:3.7 bash
+
+    pip install -e ./psycopg3[test] ./psycopg3_c
+    pytest