From: Mike Bayer Date: Wed, 14 Oct 2020 17:50:44 +0000 (-0400) Subject: block python keywords from random list of names X-Git-Tag: rel_1_3_21~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f3d46017df614836ffd10add5b2264b61f53c8d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git block python keywords from random list of names Change-Id: I0259bed2ee06e741889e8b9bed6bf6ad106fa425 (cherry picked from commit b03d5358ec83ad7484ccd452e63ab34e874b53b3) --- diff --git a/test/orm/test_inspect.py b/test/orm/test_inspect.py index 3130269b15..7e7f8d867e 100644 --- a/test/orm/test_inspect.py +++ b/test/orm/test_inspect.py @@ -434,14 +434,16 @@ class TestORMInspection(_fixtures.FixtureTest): def _random_names(self): import random + import keyword - return [ + names = { "".join( random.choice("abcdegfghijklmnopqrstuvwxyz") for i in range(random.randint(3, 15)) ) for j in range(random.randint(4, 12)) - ] + } + return list(names.difference(keyword.kwlist)) def _ordered_name_fixture(self, glbls, clsname, base, supercls): import random