Re: RFC: adding pytest as a supported test framework

From: "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
To: "Aleksander Alekseev" <aleksander(at)tigerdata(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Cc: "Andres Freund" <andres(at)anarazel(dot)de>, "Jacob Champion" <jacob(dot)champion(at)enterprisedb(dot)com>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Daniel Gustafsson" <daniel(at)yesql(dot)se>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Peter Eisentraut" <peter(at)eisentraut(dot)org>, "Nazir Bilal Yavuz" <byavuz81(at)gmail(dot)com>
Subject: Re: RFC: adding pytest as a supported test framework
Date: 2026-01-25 12:54:35
Message-ID: DFXOP22NFAEV.3T0VD64AW2C1H@jeltef.nl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon Jan 19, 2026 at 12:34 PM CET, Aleksander Alekseev wrote:
> Hi,
>
>> v10 attached to resolve merge conflicts.
>
> I tested and reviewed patches 0001 .. 0003 on Linux x64. All in all
> the code is in a pretty good shape except for several TODOs:
>
> ```
> # TODO: proper quoting
> v = v.replace("\\", "\\\\")
> v = v.replace("'", "\\'")
> v = "'{}'".format(v)
> ```

Thanks for the review. Attached is v11. I addressed this TODO by
implementing the full quoting logic.

> and:
>
> ```
> # TODO: rather than using callback(), consider explicitly signaling
> # the fn() implementation to stop early if we get an exception.
> # Otherwise we'll hang until the end of the timeout.
> self._thread = threading.Thread(target=_bg)
> self.callback(self._join)
> ```

I moved the whole local_server fixture and the test that it adds into
patch 0004, i.e. the first WIP patch by Jacob. I don't think this
functionality (nor the test it added) needs to be part of the initial
merge.

> ```
> # XXX interacts poorly with testwrap's boilerplate diagnostics
> # self.print("TAP version 13")
> ```

Removed this and changed the comment on the TAP class to specify that
we're implementing TAP 12 instead (which requires no version line).
TAP 13 doesn't seem to contain features that we currently need.

> I haven't looked at 0004 and 0005.

Makes sense. I mostly kept those patches as part of the patchset to make
sure I did not break Jacob's usecase with all my changes to the test
suite. They were more meant as: "I did not touch these patches, nor are
they ready to merge, but it's possible to do stuff like this too".

Attachment Content-Type Size
v11-0001-Add-support-for-pytest-test-suites.patch text/x-patch 27.8 KB
v11-0002-Add-pytest-infrastructure-to-interact-with-Postg.patch text/x-patch 73.7 KB
v11-0003-POC-Convert-load-balance-tests-from-perl-to-pyth.patch text/x-patch 17.3 KB
v11-0004-WIP-pytest-Add-some-SSL-client-tests.patch text/x-patch 22.4 KB
v11-0005-WIP-pytest-Add-some-server-side-SSL-tests.patch text/x-patch 8.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2026-01-25 12:57:31 Re: Cleaning up PREPARE query strings?
Previous Message Junwang Zhao 2026-01-25 12:44:33 Re: [PATCH] Replace COUNT(NULL) with '0'::bigint