From: Daniele Varrazzo Date: Mon, 11 Oct 2021 15:35:44 +0000 (+0200) Subject: Fix random test failure caused by degenerate list sample X-Git-Tag: 3.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0317bb82f018b8d44c8a360d2d9a5067aae383d8;p=thirdparty%2Fpsycopg.git Fix random test failure caused by degenerate list sample For example it would fail if a list containing an empty range would be selected. https://github.com/psycopg/psycopg/pull/102/checks?check_run_id=3859021392 --- diff --git a/tests/fix_faker.py b/tests/fix_faker.py index 63c933e73..fe1c55dc1 100644 --- a/tests/fix_faker.py +++ b/tests/fix_faker.py @@ -506,6 +506,9 @@ class Faker: spec = spec[1] return [self.make(spec) for i in range(length)] + def example_list(self, spec): + return [self.example(spec[1])] + def match_list(self, spec, got, want): assert len(got) == len(want) m = self.get_matcher(spec[1])