From: Lele Gaifax Date: Wed, 9 Nov 2022 08:17:40 +0000 (+0100) Subject: Factor out common attributes to pacify LSP checker X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=816e9615ac5d5ab3d73d58e86d31f995c849a519;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Factor out common attributes to pacify LSP checker --- diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index c10e06d45e..58c8efe916 100644 --- a/test/dialect/postgresql/test_types.py +++ b/test/dialect/postgresql/test_types.py @@ -3670,7 +3670,28 @@ class HStoreRoundTripTest(fixtures.TablesTest): eq_(s.query(Data.data, Data).all(), [(d.data, d)]) -class _RangeTypeCompilation(AssertsCompiledSQL, fixtures.TestBase): +class _RangeTests: + _col_type = None + "The concrete range class these tests are for." + + _col_str = None + "The corresponding PG type name." + + _epsilon = None + """A small value used to generate range variants""" + + def _data_str(self): + """return string form of a sample range""" + raise NotImplementedError() + + def _data_obj(self): + """return Range form of the same range""" + raise NotImplementedError() + + +class _RangeTypeCompilation( + AssertsCompiledSQL, _RangeTests, fixtures.TestBase +): __dialect__ = "postgresql" # operator tests @@ -3863,15 +3884,7 @@ class _RangeTypeCompilation(AssertsCompiledSQL, fixtures.TestBase): ) -class _RangeComparisonFixtures: - def _data_str(self): - """return string form of a sample range""" - raise NotImplementedError() - - def _data_obj(self): - """return Range form of the same range""" - raise NotImplementedError() - +class _RangeComparisonFixtures(_RangeTests): def _step_value_up(self, value): """given a value, return a step up