From 816e9615ac5d5ab3d73d58e86d31f995c849a519 Mon Sep 17 00:00:00 2001 From: Lele Gaifax Date: Wed, 9 Nov 2022 09:17:40 +0100 Subject: [PATCH] Factor out common attributes to pacify LSP checker --- test/dialect/postgresql/test_types.py | 33 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) 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 -- 2.47.3