Re: RFC: adding pytest as a supported test framework

Jacob Champion <jacob.champion@enterprisedb.com>

From: Jacob Champion <jacob.champion@enterprisedb.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>, Jelte Fennema-Nio <postgres@jeltef.nl>, Daniel Gustafsson <daniel@yesql.se>, Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter@eisentraut.org>, Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: 2025-09-18T18:22:48Z
Lists: pgsql-hackers
On Tue, Sep 9, 2025 at 2:50 PM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
> When enabling the feature, the check_pytest.py script checks that the
> configured `PYTHON` executable has all of pytest-requirements.txt
> installed. Peter pointed out that this is incorrect: what we actually
> want to check is that the interpreter used by pytest has all of the
> required packages, and the two could be different.

Turns out we've already solved this exact problem for Perl and Prove
[1], and I should probably choose a similar solution for Python and
pytest. In other words: make the requirements check into a test.

--Jacob

[1] http://postgr.es/c/c4fe3199a