pytest: improve documentation and protect against wrong versions

It's quite hard to get python2 to exit gracefully when the code was
intended for python3, because the interpreter will SyntaxError before
running a single line of code. Thankfully, the pytest developers put a
version check in their .ini config, so that should gracefully handle
both wrong-pytest-version and wrong-python-version.

Also document the woes of trying to run the pytest version shipped by
e.g. Debian or Ubuntu.
This commit is contained in:
Eric Seppanen
2021-05-03 10:48:10 -07:00
parent 129f85f652
commit 219cbe2d9c
2 changed files with 16 additions and 7 deletions

View File

@@ -3,13 +3,20 @@
This directory contains integration tests.
Prerequisites:
- pytest, psycopg2
Install using something like this:
- `pip3 install pytest psycopg2` (Debian or Ubuntu)
- an already compiled zenith + postgres tree
- See the root README.md for details
- Python 3.6 or later
- Python packages: pytest, psycopg2
- pytest 6.0 is required.
- __NOTE: `apt install` on Debian/Ubuntu won't work.__
They ship a much older version of pytest (and sometimes rename it to
`pytest-3`.)
- Install using something like this:
- `pip3 install pytest psycopg2` (Debian or Ubuntu)
- Zenith and Postgres binaries
- See the root README.md for build directions
- Tests can be run from the git tree; or see the environment variables
below to run from other directories.
- The zenith git repo, including the postgres submodule
(for some tests, e.g. pg_regress)
### Running the tests

2
test_runner/pytest.ini Normal file
View File

@@ -0,0 +1,2 @@
[pytest]
minversion = 6.0