From 0317bb82f018b8d44c8a360d2d9a5067aae383d8 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 11 Oct 2021 17:35:44 +0200 Subject: [PATCH] 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 --- tests/fix_faker.py | 3 +++ 1 file changed, 3 insertions(+) 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]) -- 2.47.3