summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-11-21 20:36:35 +0100
committerFederico Caselli <cfederico87@gmail.com>2021-11-22 15:03:17 +0000
commit0b95f0055be252b13e99b0a944466f60b5e367ff (patch)
tree6ae4135fd408c4e69582c4f6fa458b007553aeab /test
parente04baa2953fb5d0d29f5dca01ea6882bf1fa1cd4 (diff)
downloadsqlalchemy-0b95f0055be252b13e99b0a944466f60b5e367ff.tar.gz
Remove object in class definition
References: #4600 Change-Id: I2a62ddfe00bc562720f0eae700a497495d7a987a
Diffstat (limited to 'test')
-rw-r--r--test/aaa_profiling/test_memusage.py24
-rw-r--r--test/aaa_profiling/test_misc.py2
-rw-r--r--test/aaa_profiling/test_pool.py2
-rw-r--r--test/aaa_profiling/test_resultset.py4
-rw-r--r--test/base/test_events.py40
-rw-r--r--test/base/test_inspect.py4
-rw-r--r--test/base/test_tutorials.py2
-rw-r--r--test/base/test_utils.py114
-rw-r--r--test/dialect/mssql/test_query.py2
-rw-r--r--test/dialect/mysql/test_types.py2
-rw-r--r--test/dialect/oracle/test_types.py4
-rw-r--r--test/dialect/postgresql/test_compiler.py4
-rw-r--r--test/dialect/postgresql/test_dialect.py2
-rw-r--r--test/dialect/postgresql/test_on_conflict.py2
-rw-r--r--test/dialect/postgresql/test_reflection.py4
-rw-r--r--test/dialect/postgresql/test_types.py16
-rw-r--r--test/dialect/test_sqlite.py2
-rw-r--r--test/engine/test_execute.py2
-rw-r--r--test/engine/test_pool.py2
-rw-r--r--test/engine/test_transaction.py2
-rw-r--r--test/ext/declarative/test_deprecations.py8
-rw-r--r--test/ext/mypy/files/as_declarative.py2
-rw-r--r--test/ext/mypy/files/as_declarative_base.py2
-rw-r--r--test/ext/mypy/incremental/stubs_14/__init__.py2
-rw-r--r--test/ext/test_associationproxy.py40
-rw-r--r--test/ext/test_baked.py2
-rw-r--r--test/ext/test_extendedattr.py44
-rw-r--r--test/ext/test_horizontal_shard.py6
-rw-r--r--test/ext/test_hybrid.py4
-rw-r--r--test/ext/test_mutable.py14
-rw-r--r--test/ext/test_orderinglist.py8
-rw-r--r--test/orm/_fixtures.py2
-rw-r--r--test/orm/declarative/test_basic.py14
-rw-r--r--test/orm/declarative/test_clsregistry.py4
-rw-r--r--test/orm/declarative/test_deprecations.py2
-rw-r--r--test/orm/declarative/test_inheritance.py8
-rw-r--r--test/orm/declarative/test_mixin.py90
-rw-r--r--test/orm/inheritance/test_assorted_poly.py22
-rw-r--r--test/orm/inheritance/test_basic.py62
-rw-r--r--test/orm/inheritance/test_concrete.py2
-rw-r--r--test/orm/inheritance/test_manytomany.py10
-rw-r--r--test/orm/inheritance/test_poly_linked_list.py4
-rw-r--r--test/orm/inheritance/test_poly_loading.py2
-rw-r--r--test/orm/inheritance/test_productspec.py6
-rw-r--r--test/orm/test_attributes.py166
-rw-r--r--test/orm/test_cache_key.py4
-rw-r--r--test/orm/test_cascade.py10
-rw-r--r--test/orm/test_collection.py84
-rw-r--r--test/orm/test_compile.py28
-rw-r--r--test/orm/test_composites.py6
-rw-r--r--test/orm/test_core_compilation.py2
-rw-r--r--test/orm/test_deprecations.py22
-rw-r--r--test/orm/test_dynamic.py4
-rw-r--r--test/orm/test_eager_relations.py4
-rw-r--r--test/orm/test_events.py18
-rw-r--r--test/orm/test_inspect.py10
-rw-r--r--test/orm/test_instrumentation.py70
-rw-r--r--test/orm/test_joins.py2
-rw-r--r--test/orm/test_lambdas.py2
-rw-r--r--test/orm/test_lazy_relations.py4
-rw-r--r--test/orm/test_mapper.py100
-rw-r--r--test/orm/test_merge.py2
-rw-r--r--test/orm/test_of_type.py2
-rw-r--r--test/orm/test_options.py2
-rw-r--r--test/orm/test_pickled.py2
-rw-r--r--test/orm/test_query.py6
-rw-r--r--test/orm/test_rel_fn.py2
-rw-r--r--test/orm/test_relationship_criteria.py8
-rw-r--r--test/orm/test_relationships.py20
-rw-r--r--test/orm/test_session.py14
-rw-r--r--test/orm/test_subquery_relations.py4
-rw-r--r--test/orm/test_sync.py2
-rw-r--r--test/orm/test_transaction.py6
-rw-r--r--test/orm/test_unitofwork.py8
-rw-r--r--test/orm/test_unitofworkv2.py6
-rw-r--r--test/orm/test_update_delete.py10
-rw-r--r--test/orm/test_utils.py28
-rw-r--r--test/orm/test_validators.py6
-rw-r--r--test/sql/test_compare.py4
-rw-r--r--test/sql/test_defaults.py14
-rw-r--r--test/sql/test_delete.py2
-rw-r--r--test/sql/test_deprecations.py2
-rw-r--r--test/sql/test_insert.py4
-rw-r--r--test/sql/test_lambdas.py12
-rw-r--r--test/sql/test_metadata.py18
-rw-r--r--test/sql/test_operators.py4
-rw-r--r--test/sql/test_resultset.py6
-rw-r--r--test/sql/test_roles.py6
-rw-r--r--test/sql/test_select.py6
-rw-r--r--test/sql/test_type_expressions.py4
-rw-r--r--test/sql/test_types.py16
-rw-r--r--test/sql/test_update.py10
-rw-r--r--test/sql/test_values.py2
93 files changed, 685 insertions, 685 deletions
diff --git a/test/aaa_profiling/test_memusage.py b/test/aaa_profiling/test_memusage.py
index 518b215dd..a876108a6 100644
--- a/test/aaa_profiling/test_memusage.py
+++ b/test/aaa_profiling/test_memusage.py
@@ -335,7 +335,7 @@ class MemUsageTest(EnsureZeroed):
@testing.fails()
def test_fixture_failure(self):
- class Foo(object):
+ class Foo:
pass
stuff = []
@@ -356,7 +356,7 @@ class MemUsageWBackendTest(fixtures.MappedTest, EnsureZeroed):
# ensure a pure growing test trips the assertion
@testing.fails_if(lambda: True)
def test_fixture(self):
- class Foo(object):
+ class Foo:
pass
x = []
@@ -556,7 +556,7 @@ class MemUsageWBackendTest(fixtures.MappedTest, EnsureZeroed):
*[Column("col%d" % i, Integer) for i in range(10)]
)
- class Wide(object):
+ class Wide:
pass
self.mapper_registry.map_imperatively(
@@ -604,7 +604,7 @@ class MemUsageWBackendTest(fixtures.MappedTest, EnsureZeroed):
),
)
- class SomeClass(object):
+ class SomeClass:
pass
self.mapper_registry.map_imperatively(SomeClass, some_table)
@@ -1021,7 +1021,7 @@ class MemUsageWBackendTest(fixtures.MappedTest, EnsureZeroed):
Column("t1id", ForeignKey("t1.id")),
)
- class T1(object):
+ class T1:
pass
t1_mapper = self.mapper_registry.map_imperatively(T1, t1)
@@ -1029,7 +1029,7 @@ class MemUsageWBackendTest(fixtures.MappedTest, EnsureZeroed):
@testing.emits_warning()
@profile_memory()
def go():
- class T2(object):
+ class T2:
pass
t2_mapper = self.mapper_registry.map_imperatively(T2, t2)
@@ -1065,10 +1065,10 @@ class MemUsageWBackendTest(fixtures.MappedTest, EnsureZeroed):
Column("t1id", Integer, ForeignKey("table1.id")),
)
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
self.mapper_registry.map_imperatively(
@@ -1119,10 +1119,10 @@ class MemUsageWBackendTest(fixtures.MappedTest, EnsureZeroed):
Column("t1id", Integer, ForeignKey("table1.id")),
)
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
self.mapper_registry.map_imperatively(
@@ -1203,7 +1203,7 @@ class CycleTest(_fixtures.FixtureTest):
users = self.tables.users
- class Foo(object):
+ class Foo:
@hybrid.hybrid_property
def user_name(self):
return self.name
@@ -1593,7 +1593,7 @@ class CycleTest(_fixtures.FixtureTest):
go()
def test_weak_sequence(self):
- class Foo(object):
+ class Foo:
pass
f = Foo()
diff --git a/test/aaa_profiling/test_misc.py b/test/aaa_profiling/test_misc.py
index 3d6700542..4f811e69a 100644
--- a/test/aaa_profiling/test_misc.py
+++ b/test/aaa_profiling/test_misc.py
@@ -20,7 +20,7 @@ class EnumTest(fixtures.TestBase):
__requires__ = ("cpython", "python_profiling_backend")
def setup_test(self):
- class SomeEnum(object):
+ class SomeEnum:
# Implements PEP 435 in the minimal fashion needed by SQLAlchemy
_members = {}
diff --git a/test/aaa_profiling/test_pool.py b/test/aaa_profiling/test_pool.py
index 2b1a490c2..374fa2382 100644
--- a/test/aaa_profiling/test_pool.py
+++ b/test/aaa_profiling/test_pool.py
@@ -10,7 +10,7 @@ pool = None
class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults):
__requires__ = ("cpython", "python_profiling_backend")
- class Connection(object):
+ class Connection:
def rollback(self):
pass
diff --git a/test/aaa_profiling/test_resultset.py b/test/aaa_profiling/test_resultset.py
index 83788ce46..1f777e42e 100644
--- a/test/aaa_profiling/test_resultset.py
+++ b/test/aaa_profiling/test_resultset.py
@@ -211,7 +211,7 @@ class RowTest(fixtures.TestBase):
__backend__ = True
def _rowproxy_fixture(self, keys, processors, row, row_cls):
- class MockMeta(object):
+ class MockMeta:
def __init__(self):
pass
@@ -260,7 +260,7 @@ class RowTest(fixtures.TestBase):
self._test_getitem_value_refcounts_new(tuple)
def test_value_refcounts_custom_seq(self):
- class CustomSeq(object):
+ class CustomSeq:
def __init__(self, data):
self.data = data
diff --git a/test/base/test_events.py b/test/base/test_events.py
index d38f61c1e..c94de7dd5 100644
--- a/test/base/test_events.py
+++ b/test/base/test_events.py
@@ -15,7 +15,7 @@ from sqlalchemy.testing.mock import Mock
from sqlalchemy.testing.util import gc_collect
-class TearDownLocalEventsFixture(object):
+class TearDownLocalEventsFixture:
def teardown_test(self):
classes = set()
for entry in event.base._registrars.values():
@@ -41,7 +41,7 @@ class EventsTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_three(self, x):
pass
- class Target(object):
+ class Target:
dispatch = event.dispatcher(TargetEvents)
self.Target = Target
@@ -269,7 +269,7 @@ class EventsTest(TearDownLocalEventsFixture, fixtures.TestBase):
class SlotsEventsTest(fixtures.TestBase):
def test_no_slots_dispatch(self):
- class Target(object):
+ class Target:
__slots__ = ()
class TargetEvents(event.Events):
@@ -294,7 +294,7 @@ class SlotsEventsTest(fixtures.TestBase):
event.listen(t1, "event_one", Mock())
def test_slots_dispatch(self):
- class Target(object):
+ class Target:
__slots__ = ("_slots_dispatch",)
class TargetEvents(event.Events):
@@ -331,7 +331,7 @@ class NamedCallTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_five(self, x, y, z, q):
pass
- class TargetOne(object):
+ class TargetOne:
dispatch = event.dispatcher(TargetEventsOne)
return TargetOne
@@ -355,7 +355,7 @@ class NamedCallTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_five(self, x, y, z, q):
pass
- class Target(object):
+ class Target:
dispatch = event.dispatcher(TargetEvents)
return Target
@@ -453,7 +453,7 @@ class LegacySignatureTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_six(self, x, y):
pass
- class TargetOne(object):
+ class TargetOne:
dispatch = event.dispatcher(TargetEventsOne)
self.TargetOne = TargetOne
@@ -556,7 +556,7 @@ class LegacySignatureTest(TearDownLocalEventsFixture, fixtures.TestBase):
def test_legacy_accept_from_method(self):
canary = Mock()
- class MyClass(object):
+ class MyClass:
def handler1(self, x, y):
canary(x, y)
@@ -612,7 +612,7 @@ class ClsLevelListenTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_one(self, x, y):
pass
- class TargetOne(object):
+ class TargetOne:
dispatch = event.dispatcher(TargetEventsOne)
self.TargetOne = TargetOne
@@ -685,10 +685,10 @@ class AcceptTargetsTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_one(self, x, y):
pass
- class TargetOne(object):
+ class TargetOne:
dispatch = event.dispatcher(TargetEventsOne)
- class TargetTwo(object):
+ class TargetTwo:
dispatch = event.dispatcher(TargetEventsTwo)
self.TargetOne = TargetOne
@@ -745,7 +745,7 @@ class CustomTargetsTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_one(self, x, y):
pass
- class Target(object):
+ class Target:
dispatch = event.dispatcher(TargetEvents)
self.Target = Target
@@ -775,7 +775,7 @@ class SubclassGrowthTest(TearDownLocalEventsFixture, fixtures.TestBase):
def some_event(self, x, y):
pass
- class Target(object):
+ class Target:
dispatch = event.dispatcher(TargetEvents)
self.Target = Target
@@ -813,7 +813,7 @@ class ListenOverrideTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_one(self, x, y):
pass
- class Target(object):
+ class Target:
dispatch = event.dispatcher(TargetEvents)
self.Target = Target
@@ -862,7 +862,7 @@ class PropagateTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_two(self, arg):
pass
- class Target(object):
+ class Target:
dispatch = event.dispatcher(TargetEvents)
self.Target = Target
@@ -893,7 +893,7 @@ class JoinTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_one(self, target, arg):
pass
- class BaseTarget(object):
+ class BaseTarget:
dispatch = event.dispatcher(TargetEvents)
class TargetFactory(BaseTarget):
@@ -1113,7 +1113,7 @@ class DisableClsPropagateTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_one(self, target, arg):
pass
- class BaseTarget(object):
+ class BaseTarget:
dispatch = event.dispatcher(TargetEvents)
class SubTarget(BaseTarget):
@@ -1171,7 +1171,7 @@ class RemovalTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_three(self, x):
pass
- class Target(object):
+ class Target:
dispatch = event.dispatcher(TargetEvents)
return Target
@@ -1192,7 +1192,7 @@ class RemovalTest(TearDownLocalEventsFixture, fixtures.TestBase):
def event_one(self, x):
pass
- class Target(object):
+ class Target:
dispatch = event.dispatcher(TargetEvents)
return Target
@@ -1235,7 +1235,7 @@ class RemovalTest(TearDownLocalEventsFixture, fixtures.TestBase):
def test_instance(self):
Target = self._fixture()
- class Foo(object):
+ class Foo:
def __init__(self):
self.mock = Mock()
diff --git a/test/base/test_inspect.py b/test/base/test_inspect.py
index 252d0d977..fd433ce99 100644
--- a/test/base/test_inspect.py
+++ b/test/base/test_inspect.py
@@ -8,7 +8,7 @@ from sqlalchemy.testing import eq_
from sqlalchemy.testing import fixtures
-class TestFixture(object):
+class TestFixture:
pass
@@ -45,7 +45,7 @@ class TestInspection(fixtures.TestBase):
class SomeFoo(TestFixture):
pass
- class SomeFooInspect(object):
+ class SomeFooInspect:
def __init__(self, target):
self.target = target
diff --git a/test/base/test_tutorials.py b/test/base/test_tutorials.py
index 2393a7f91..c8c51b0b5 100644
--- a/test/base/test_tutorials.py
+++ b/test/base/test_tutorials.py
@@ -14,7 +14,7 @@ class DocTest(fixtures.TestBase):
def _setup_logger(self):
rootlogger = logging.getLogger("sqlalchemy.engine.Engine")
- class MyStream(object):
+ class MyStream:
def write(self, string):
sys.stdout.write(string)
sys.stdout.flush()
diff --git a/test/base/test_utils.py b/test/base/test_utils.py
index 81e402d93..8674f4779 100644
--- a/test/base/test_utils.py
+++ b/test/base/test_utils.py
@@ -35,7 +35,7 @@ from sqlalchemy.util import WeakSequence
class WeakSequenceTest(fixtures.TestBase):
@testing.requires.predictable_gc
def test_cleanout_elements(self):
- class Foo(object):
+ class Foo:
pass
f1, f2, f3 = Foo(), Foo(), Foo()
@@ -49,7 +49,7 @@ class WeakSequenceTest(fixtures.TestBase):
@testing.requires.predictable_gc
def test_cleanout_appended(self):
- class Foo(object):
+ class Foo:
pass
f1, f2, f3 = Foo(), Foo(), Foo()
@@ -273,7 +273,7 @@ class MemoizedAttrTest(fixtures.TestBase):
def test_memoized_property(self):
val = [20]
- class Foo(object):
+ class Foo:
@util.memoized_property
def bar(self):
v = val[0]
@@ -291,7 +291,7 @@ class MemoizedAttrTest(fixtures.TestBase):
def test_memoized_instancemethod(self):
val = [20]
- class Foo(object):
+ class Foo:
@util.memoized_instancemethod
def bar(self):
v = val[0]
@@ -354,7 +354,7 @@ class WrapCallableTest(fixtures.TestBase):
eq_(c.__doc__, None)
def test_wrapping_update_wrapper_cls(self):
- class MyFancyDefault(object):
+ class MyFancyDefault:
"""a fancy default"""
def __call__(self):
@@ -368,7 +368,7 @@ class WrapCallableTest(fixtures.TestBase):
eq_(c.__doc__, "run the fancy default")
def test_wrapping_update_wrapper_cls_noclsdocstring(self):
- class MyFancyDefault(object):
+ class MyFancyDefault:
def __call__(self):
"""run the fancy default"""
return 10
@@ -379,7 +379,7 @@ class WrapCallableTest(fixtures.TestBase):
eq_(c.__doc__, "run the fancy default")
def test_wrapping_update_wrapper_cls_nomethdocstring(self):
- class MyFancyDefault(object):
+ class MyFancyDefault:
"""a fancy default"""
def __call__(self):
@@ -391,7 +391,7 @@ class WrapCallableTest(fixtures.TestBase):
eq_(c.__doc__, "a fancy default")
def test_wrapping_update_wrapper_cls_noclsdocstring_nomethdocstring(self):
- class MyFancyDefault(object):
+ class MyFancyDefault:
def __call__(self):
return 10
@@ -1144,7 +1144,7 @@ class DedupeColumnCollectionTest(ColumnCollectionCommon, fixtures.TestBase):
class LRUTest(fixtures.TestBase):
def test_lru(self):
- class item(object):
+ class item:
def __init__(self, id_):
self.id = id_
@@ -1217,7 +1217,7 @@ class FlattenIteratorTest(fixtures.TestBase):
assert list(util.flatten_iterator(iter_list)) == ["asdf", "x", "y"]
-class HashOverride(object):
+class HashOverride:
def __init__(self, value=None):
self.value = value
@@ -1225,14 +1225,14 @@ class HashOverride(object):
return hash(self.value)
-class NoHash(object):
+class NoHash:
def __init__(self, value=None):
self.value = value
__hash__ = None
-class EqOverride(object):
+class EqOverride:
def __init__(self, value=None):
self.value = value
@@ -1251,7 +1251,7 @@ class EqOverride(object):
return True
-class HashEqOverride(object):
+class HashEqOverride:
def __init__(self, value=None):
self.value = value
@@ -1881,21 +1881,21 @@ class DictlikeIteritemsTest(fixtures.TestBase):
self._notok(object())
def test_duck_2(self):
- class duck2(object):
+ class duck2:
def items(duck):
return list(self.baseline)
self._ok(duck2())
def test_duck_4(self):
- class duck4(object):
+ class duck4:
def iterkeys(duck):
return iter(["a", "b", "c"])
self._notok(duck4())
def test_duck_5(self):
- class duck5(object):
+ class duck5:
def keys(duck):
return ["a", "b", "c"]
@@ -1905,7 +1905,7 @@ class DictlikeIteritemsTest(fixtures.TestBase):
self._ok(duck5())
def test_duck_6(self):
- class duck6(object):
+ class duck6:
def keys(duck):
return ["a", "b", "c"]
@@ -1914,7 +1914,7 @@ class DictlikeIteritemsTest(fixtures.TestBase):
class DuckTypeCollectionTest(fixtures.TestBase):
def test_sets(self):
- class SetLike(object):
+ class SetLike:
def add(self):
pass
@@ -1934,7 +1934,7 @@ class DuckTypeCollectionTest(fixtures.TestBase):
class PublicFactoryTest(fixtures.TestBase):
def _fixture(self):
- class Thingy(object):
+ class Thingy:
def __init__(self, value):
"make a thingy"
self.value = value
@@ -1969,7 +1969,7 @@ class PublicFactoryTest(fixtures.TestBase):
class ArgInspectionTest(fixtures.TestBase):
def test_get_cls_kwargs(self):
- class A(object):
+ class A:
def __init__(self, a):
pass
@@ -1981,7 +1981,7 @@ class ArgInspectionTest(fixtures.TestBase):
def __init__(self, a11, **kw):
pass
- class B(object):
+ class B:
def __init__(self, b, **kw):
pass
@@ -2022,7 +2022,7 @@ class ArgInspectionTest(fixtures.TestBase):
class CB2A(B2, A):
pass
- class D(object):
+ class D:
pass
class BA2(B, A):
@@ -2113,7 +2113,7 @@ class ArgInspectionTest(fixtures.TestBase):
assert_raises(TypeError, get_callable_argspec, object)
def test_callable_argspec_method(self):
- class Foo(object):
+ class Foo:
def foo(self, x, y, **kw):
pass
@@ -2125,7 +2125,7 @@ class ArgInspectionTest(fixtures.TestBase):
)
def test_callable_argspec_instance_method_no_self(self):
- class Foo(object):
+ class Foo:
def foo(self, x, y, **kw):
pass
@@ -2135,7 +2135,7 @@ class ArgInspectionTest(fixtures.TestBase):
)
def test_callable_argspec_unbound_method_no_self(self):
- class Foo(object):
+ class Foo:
def foo(self, x, y, **kw):
pass
@@ -2147,7 +2147,7 @@ class ArgInspectionTest(fixtures.TestBase):
)
def test_callable_argspec_init(self):
- class Foo(object):
+ class Foo:
def __init__(self, x, y):
pass
@@ -2159,7 +2159,7 @@ class ArgInspectionTest(fixtures.TestBase):
)
def test_callable_argspec_init_no_self(self):
- class Foo(object):
+ class Foo:
def __init__(self, x, y):
pass
@@ -2169,7 +2169,7 @@ class ArgInspectionTest(fixtures.TestBase):
)
def test_callable_argspec_call(self):
- class Foo(object):
+ class Foo:
def __call__(self, x, y):
pass
@@ -2181,7 +2181,7 @@ class ArgInspectionTest(fixtures.TestBase):
)
def test_callable_argspec_call_no_self(self):
- class Foo(object):
+ class Foo:
def __call__(self, x, y):
pass
@@ -2335,7 +2335,7 @@ class SymbolTest(fixtures.TestBase):
)
-class _Py3KFixtures(object):
+class _Py3KFixtures:
def _kw_only_fixture(self):
pass
@@ -2647,18 +2647,18 @@ class TestFormatArgspec(_Py3KFixtures, fixtures.TestBase):
parsed = util.format_argspec_init(fn, grouped=grouped)
eq_(parsed, wanted)
- class Obj(object):
+ class Obj:
pass
test(Obj.__init__, object_spec)
- class Obj(object):
+ class Obj:
def __init__(self):
pass
test(Obj.__init__, object_spec)
- class Obj(object):
+ class Obj:
def __init__(slef, a=123):
pass
@@ -2690,7 +2690,7 @@ class TestFormatArgspec(_Py3KFixtures, fixtures.TestBase):
class GenericReprTest(fixtures.TestBase):
def test_all_positional(self):
- class Foo(object):
+ class Foo:
def __init__(self, a, b, c):
self.a = a
self.b = b
@@ -2699,7 +2699,7 @@ class GenericReprTest(fixtures.TestBase):
eq_(util.generic_repr(Foo(1, 2, 3)), "Foo(1, 2, 3)")
def test_positional_plus_kw(self):
- class Foo(object):
+ class Foo:
def __init__(self, a, b, c=5, d=4):
self.a = a
self.b = b
@@ -2709,7 +2709,7 @@ class GenericReprTest(fixtures.TestBase):
eq_(util.generic_repr(Foo(1, 2, 3, 6)), "Foo(1, 2, c=3, d=6)")
def test_kw_defaults(self):
- class Foo(object):
+ class Foo:
def __init__(self, a=1, b=2, c=3, d=4):
self.a = a
self.b = b
@@ -2719,7 +2719,7 @@ class GenericReprTest(fixtures.TestBase):
eq_(util.generic_repr(Foo(1, 5, 3, 7)), "Foo(b=5, d=7)")
def test_multi_kw(self):
- class Foo(object):
+ class Foo:
def __init__(self, a, b, c=3, d=4):
self.a = a
self.b = b
@@ -2746,7 +2746,7 @@ class GenericReprTest(fixtures.TestBase):
)
def test_multi_kw_repeated(self):
- class Foo(object):
+ class Foo:
def __init__(self, a=1, b=2):
self.a = a
self.b = b
@@ -2762,7 +2762,7 @@ class GenericReprTest(fixtures.TestBase):
)
def test_discard_vargs(self):
- class Foo(object):
+ class Foo:
def __init__(self, a, b, *args):
self.a = a
self.b = b
@@ -2771,7 +2771,7 @@ class GenericReprTest(fixtures.TestBase):
eq_(util.generic_repr(Foo(1, 2, 3, 4)), "Foo(1, 2)")
def test_discard_vargs_kwargs(self):
- class Foo(object):
+ class Foo:
def __init__(self, a, b, *args, **kw):
self.a = a
self.b = b
@@ -2780,7 +2780,7 @@ class GenericReprTest(fixtures.TestBase):
eq_(util.generic_repr(Foo(1, 2, 3, 4, x=7, y=4)), "Foo(1, 2)")
def test_significant_vargs(self):
- class Foo(object):
+ class Foo:
def __init__(self, a, b, *args):
self.a = a
self.b = b
@@ -2789,21 +2789,21 @@ class GenericReprTest(fixtures.TestBase):
eq_(util.generic_repr(Foo(1, 2, 3, 4)), "Foo(1, 2, 3, 4)")
def test_no_args(self):
- class Foo(object):
+ class Foo:
def __init__(self):
pass
eq_(util.generic_repr(Foo()), "Foo()")
def test_no_init(self):
- class Foo(object):
+ class Foo:
pass
eq_(util.generic_repr(Foo()), "Foo()")
class AsInterfaceTest(fixtures.TestBase):
- class Something(object):
+ class Something:
def _ignoreme(self):
pass
@@ -2813,11 +2813,11 @@ class AsInterfaceTest(fixtures.TestBase):
def bar(self):
pass
- class Partial(object):
+ class Partial:
def bar(self):
pass
- class Object(object):
+ class Object:
pass
def test_no_cls_no_methods(self):
@@ -2931,10 +2931,10 @@ class TestClassHierarchy(fixtures.TestBase):
eq_(set(util.class_hierarchy(object)), set((object,)))
def test_single(self):
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
eq_(set(util.class_hierarchy(A)), set((A, object)))
@@ -3009,7 +3009,7 @@ class ReraiseTest(fixtures.TestBase):
class TestClassProperty(fixtures.TestBase):
def test_simple(self):
- class A(object):
+ class A:
something = {"foo": 1}
class B(A):
@@ -3269,7 +3269,7 @@ class TestModuleRegistry(fixtures.TestBase):
class MethodOveriddenTest(fixtures.TestBase):
def test_subclass_overrides_cls_given(self):
- class Foo(object):
+ class Foo:
def bar(self):
pass
@@ -3280,7 +3280,7 @@ class MethodOveriddenTest(fixtures.TestBase):
is_true(util.method_is_overridden(Bar, Foo.bar))
def test_subclass_overrides(self):
- class Foo(object):
+ class Foo:
def bar(self):
pass
@@ -3291,7 +3291,7 @@ class MethodOveriddenTest(fixtures.TestBase):
is_true(util.method_is_overridden(Bar(), Foo.bar))
def test_subclass_overrides_skiplevel(self):
- class Foo(object):
+ class Foo:
def bar(self):
pass
@@ -3305,7 +3305,7 @@ class MethodOveriddenTest(fixtures.TestBase):
is_true(util.method_is_overridden(Bat(), Foo.bar))
def test_subclass_overrides_twolevels(self):
- class Foo(object):
+ class Foo:
def bar(self):
pass
@@ -3319,7 +3319,7 @@ class MethodOveriddenTest(fixtures.TestBase):
is_true(util.method_is_overridden(Bat(), Foo.bar))
def test_subclass_doesnt_override_cls_given(self):
- class Foo(object):
+ class Foo:
def bar(self):
pass
@@ -3329,7 +3329,7 @@ class MethodOveriddenTest(fixtures.TestBase):
is_false(util.method_is_overridden(Bar, Foo.bar))
def test_subclass_doesnt_override(self):
- class Foo(object):
+ class Foo:
def bar(self):
pass
@@ -3339,10 +3339,10 @@ class MethodOveriddenTest(fixtures.TestBase):
is_false(util.method_is_overridden(Bar(), Foo.bar))
def test_subclass_overrides_multi_mro(self):
- class Base(object):
+ class Base:
pass
- class Foo(object):
+ class Foo:
pass
class Bat(Base):
diff --git a/test/dialect/mssql/test_query.py b/test/dialect/mssql/test_query.py
index 63b2551cd..3576a9fc2 100644
--- a/test/dialect/mssql/test_query.py
+++ b/test/dialect/mssql/test_query.py
@@ -373,7 +373,7 @@ class QueryTest(testing.AssertsExecutionResults, fixtures.TestBase):
eq_(connection.scalar(table.select()), 7)
-class Foo(object):
+class Foo:
def __init__(self, **kw):
for k in kw:
setattr(self, k, kw[k])
diff --git a/test/dialect/mysql/test_types.py b/test/dialect/mysql/test_types.py
index 7bdf6f8ce..c83de7f49 100644
--- a/test/dialect/mysql/test_types.py
+++ b/test/dialect/mysql/test_types.py
@@ -778,7 +778,7 @@ class EnumSetTest(
__dialect__ = mysql.dialect()
__backend__ = True
- class SomeEnum(object):
+ class SomeEnum:
# Implements PEP 435 in the minimal fashion needed by SQLAlchemy
__members__ = OrderedDict()
diff --git a/test/dialect/oracle/test_types.py b/test/dialect/oracle/test_types.py
index cbbb7be7c..703472055 100644
--- a/test/dialect/oracle/test_types.py
+++ b/test/dialect/oracle/test_types.py
@@ -64,7 +64,7 @@ class DialectTypesTest(fixtures.TestBase, AssertsCompiledSQL):
from setting up cx_oracle.CLOBs on
string-based bind params [ticket:793]."""
- class FakeDBAPI(object):
+ class FakeDBAPI:
def __getattr__(self, attr):
return attr
@@ -1190,7 +1190,7 @@ class SetInputSizesTest(fixtures.TestBase):
)
t3 = Table("t3", m, Column("foo", TestTypeDec()))
- class CursorWrapper(object):
+ class CursorWrapper:
# cx_oracle cursor can't be modified so we have to
# invent a whole wrapping scheme
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 46adc62e5..93513c39d 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -2799,7 +2799,7 @@ class DistinctOnTest(fixtures.MappedTest, AssertsCompiledSQL):
def test_query_on_columns_subquery(self):
sess = Session()
- class Foo(object):
+ class Foo:
pass
clear_mappers()
@@ -2817,7 +2817,7 @@ class DistinctOnTest(fixtures.MappedTest, AssertsCompiledSQL):
)
def test_query_distinct_on_aliased(self):
- class Foo(object):
+ class Foo:
pass
self.mapper_registry.map_imperatively(Foo, self.table)
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py
index 47a4728b4..7d4ea2ced 100644
--- a/test/dialect/postgresql/test_dialect.py
+++ b/test/dialect/postgresql/test_dialect.py
@@ -278,7 +278,7 @@ class PGCodeTest(fixtures.TestBase):
eq_(errmsg.orig.sqlstate, "23505")
-class ExecuteManyMode(object):
+class ExecuteManyMode:
__only_on__ = "postgresql+psycopg2"
__backend__ = True
diff --git a/test/dialect/postgresql/test_on_conflict.py b/test/dialect/postgresql/test_on_conflict.py
index 508f691c5..8adc91a17 100644
--- a/test/dialect/postgresql/test_on_conflict.py
+++ b/test/dialect/postgresql/test_on_conflict.py
@@ -281,7 +281,7 @@ class OnConflictTest(fixtures.TablesTest):
def test_on_conflict_do_update_clauseelem_as_key_set(self, connection):
users = self.tables.users
- class MyElem(object):
+ class MyElem:
def __init__(self, expr):
self.expr = expr
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py
index fa90ec212..2bfce557f 100644
--- a/test/dialect/postgresql/test_reflection.py
+++ b/test/dialect/postgresql/test_reflection.py
@@ -40,7 +40,7 @@ from sqlalchemy.testing.assertions import is_
from sqlalchemy.testing.assertions import is_true
-class ReflectionFixtures(object):
+class ReflectionFixtures:
@testing.fixture(
params=[
("engine", True),
@@ -1773,7 +1773,7 @@ class ReflectionTest(
class CustomTypeReflectionTest(fixtures.TestBase):
- class CustomType(object):
+ class CustomType:
def __init__(self, arg1=None, arg2=None):
self.arg1 = arg1
self.arg2 = arg2
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py
index 473e14455..4c0b91f93 100644
--- a/test/dialect/postgresql/test_types.py
+++ b/test/dialect/postgresql/test_types.py
@@ -1437,7 +1437,7 @@ AnEnum("Bar", 2)
AnEnum("Baz", 3)
-class ArrayRoundTripTest(object):
+class ArrayRoundTripTest:
__only_on__ = "postgresql"
__backend__ = True
@@ -3189,7 +3189,7 @@ class HStoreRoundTripTest(fixtures.TablesTest):
self._assert_data([{r"key \"foo\"": r'value \"bar"\ xyz'}], connection)
def test_orm_round_trip(self, registry):
- class Data(object):
+ class Data:
def __init__(self, name, data):
self.name = name
self.data = data
@@ -3446,7 +3446,7 @@ class _RangeTypeRoundTrip(fixtures.TablesTest):
eq_(data, [(self._data_obj().__class__(empty=True),)])
-class _Int4RangeTests(object):
+class _Int4RangeTests:
_col_type = INT4RANGE
_col_str = "INT4RANGE"
@@ -3458,7 +3458,7 @@ class _Int4RangeTests(object):
return self.extras().NumericRange(1, 2)
-class _Int8RangeTests(object):
+class _Int8RangeTests:
_col_type = INT8RANGE
_col_str = "INT8RANGE"
@@ -3472,7 +3472,7 @@ class _Int8RangeTests(object):
)
-class _NumRangeTests(object):
+class _NumRangeTests:
_col_type = NUMRANGE
_col_str = "NUMRANGE"
@@ -3486,7 +3486,7 @@ class _NumRangeTests(object):
)
-class _DateRangeTests(object):
+class _DateRangeTests:
_col_type = DATERANGE
_col_str = "DATERANGE"
@@ -3500,7 +3500,7 @@ class _DateRangeTests(object):
)
-class _DateTimeRangeTests(object):
+class _DateTimeRangeTests:
_col_type = TSRANGE
_col_str = "TSRANGE"
@@ -3515,7 +3515,7 @@ class _DateTimeRangeTests(object):
)
-class _DateTimeTZRangeTests(object):
+class _DateTimeTZRangeTests:
_col_type = TSTZRANGE
_col_str = "TSTZRANGE"
diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py
index ca203ad8c..f827533d4 100644
--- a/test/dialect/test_sqlite.py
+++ b/test/dialect/test_sqlite.py
@@ -2962,7 +2962,7 @@ class OnConflictTest(fixtures.TablesTest):
def test_on_conflict_do_update_clauseelem_keys(self, connection):
users = self.tables.users
- class MyElem(object):
+ class MyElem:
def __init__(self, expr):
self.expr = expr
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py
index 3ca763c32..e1c86444d 100644
--- a/test/engine/test_execute.py
+++ b/test/engine/test_execute.py
@@ -60,7 +60,7 @@ class SomeException(Exception):
pass
-class Foo(object):
+class Foo:
def __str__(self):
return "foo"
diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py
index 1c730334a..b1a099d31 100644
--- a/test/engine/test_pool.py
+++ b/test/engine/test_pool.py
@@ -384,7 +384,7 @@ class PoolDialectTest(PoolTestBase):
def _dialect(self):
canary = []
- class PoolDialect(object):
+ class PoolDialect:
is_async = False
def do_rollback(self, dbapi_connection):
diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py
index e18f1c446..e3be847e8 100644
--- a/test/engine/test_transaction.py
+++ b/test/engine/test_transaction.py
@@ -1560,7 +1560,7 @@ class ConnectionCharacteristicTest(fixtures.TestBase):
)
-class ResetFixture(object):
+class ResetFixture:
@testing.fixture()
def reset_agent(self, testing_engine):
engine = testing_engine()
diff --git a/test/ext/declarative/test_deprecations.py b/test/ext/declarative/test_deprecations.py
index 130c12738..58ad2fced 100644
--- a/test/ext/declarative/test_deprecations.py
+++ b/test/ext/declarative/test_deprecations.py
@@ -13,7 +13,7 @@ from sqlalchemy.testing import is_true
class TestInstrumentDeclarative(fixtures.TestBase):
def test_ok(self):
- class Foo(object):
+ class Foo:
__tablename__ = "foo"
id = sa.Column(sa.Integer, primary_key=True)
@@ -50,7 +50,7 @@ class DeprecatedImportsTest(fixtures.TestBase):
with self._expect_warning("as_declarative"):
@legacy_decl.as_declarative()
- class Base(object):
+ class Base:
pass
class Foo(Base):
@@ -61,7 +61,7 @@ class DeprecatedImportsTest(fixtures.TestBase):
def test_has_inherited_table(self, registry):
@registry.mapped
- class Foo(object):
+ class Foo:
__tablename__ = "foo"
id = sa.Column(sa.Integer, primary_key=True)
@@ -80,7 +80,7 @@ class DeprecatedImportsTest(fixtures.TestBase):
with self._expect_warning("synonym_for"):
@registry.mapped
- class Foo(object):
+ class Foo:
__tablename__ = "foo"
id = sa.Column(sa.Integer, primary_key=True)
diff --git a/test/ext/mypy/files/as_declarative.py b/test/ext/mypy/files/as_declarative.py
index ee2f258cb..08f08f913 100644
--- a/test/ext/mypy/files/as_declarative.py
+++ b/test/ext/mypy/files/as_declarative.py
@@ -11,7 +11,7 @@ from sqlalchemy.sql.schema import ForeignKey
@as_declarative()
-class Base(object):
+class Base:
updated_at = Column(Integer)
diff --git a/test/ext/mypy/files/as_declarative_base.py b/test/ext/mypy/files/as_declarative_base.py
index efba8c362..ba62e7276 100644
--- a/test/ext/mypy/files/as_declarative_base.py
+++ b/test/ext/mypy/files/as_declarative_base.py
@@ -7,7 +7,7 @@ reg: registry = registry()
@reg.as_declarative_base()
-class Base(object):
+class Base:
updated_at = Column(Integer)
diff --git a/test/ext/mypy/incremental/stubs_14/__init__.py b/test/ext/mypy/incremental/stubs_14/__init__.py
index c40dd273a..31696458e 100644
--- a/test/ext/mypy/incremental/stubs_14/__init__.py
+++ b/test/ext/mypy/incremental/stubs_14/__init__.py
@@ -13,7 +13,7 @@ if TYPE_CHECKING:
@as_declarative()
-class Base(object):
+class Base:
@declared_attr
def __tablename__(self) -> Mapped[str]:
return self.__name__.lower()
diff --git a/test/ext/test_associationproxy.py b/test/ext/test_associationproxy.py
index 0b05fe038..ae5e6c848 100644
--- a/test/ext/test_associationproxy.py
+++ b/test/ext/test_associationproxy.py
@@ -60,7 +60,7 @@ class ListCollection(list):
pass
-class ObjectCollection(object):
+class ObjectCollection:
def __init__(self):
self.values = list()
@@ -103,14 +103,14 @@ class AutoFlushTest(fixtures.MappedTest):
)
def _fixture(self, collection_class, is_dict=False):
- class Parent(object):
+ class Parent:
collection = association_proxy("_collection", "child")
- class Child(object):
+ class Child:
def __init__(self, name):
self.name = name
- class Association(object):
+ class Association:
if is_dict:
def __init__(self, key, child):
@@ -974,7 +974,7 @@ class ScalarTest(fixtures.MappedTest):
Column("baz", String(128)),
)
- class Parent(object):
+ class Parent:
foo = association_proxy("child", "foo")
bar = association_proxy(
"child", "bar", creator=lambda v: Child(bar=v)
@@ -986,7 +986,7 @@ class ScalarTest(fixtures.MappedTest):
def __init__(self, name):
self.name = name
- class Child(object):
+ class Child:
def __init__(self, **kw):
for attr in kw:
setattr(self, attr, kw[attr])
@@ -1095,14 +1095,14 @@ class ScalarTest(fixtures.MappedTest):
Column("name", String(50)),
)
- class A(object):
+ class A:
a2b_name = association_proxy("a2b_single", "name")
b_single = association_proxy("a2b_single", "b")
- class A2B(object):
+ class A2B:
pass
- class B(object):
+ class B:
pass
self.mapper_registry.map_imperatively(
@@ -1136,12 +1136,12 @@ class ScalarTest(fixtures.MappedTest):
get = Mock()
set_ = Mock()
- class Parent(object):
+ class Parent:
foo = association_proxy(
"child", "foo", getset_factory=lambda cc, parent: (get, set_)
)
- class Child(object):
+ class Child:
def __init__(self, foo):
self.foo = foo
@@ -1319,17 +1319,17 @@ class LazyLoadTest(fixtures.MappedTest):
self.assert_(p._children is not None)
-class Parent(object):
+class Parent:
def __init__(self, name):
self.name = name
-class Child(object):
+class Child:
def __init__(self, name):
self.name = name
-class KVChild(object):
+class KVChild:
def __init__(self, name, value):
self.name = name
self.value = value
@@ -1461,7 +1461,7 @@ class ReconstitutionTest(fixtures.MappedTest):
# assert r2 == {'c1': 'c1', 'c2': 'c2'}
-class PickleKeyFunc(object):
+class PickleKeyFunc:
def __init__(self, name):
self.name = name
@@ -2483,7 +2483,7 @@ class AttributeAccessTest(fixtures.TestBase):
Base = declarative_base()
- class Mixin(object):
+ class Mixin:
@declared_attr
def children(cls):
return association_proxy("_children", "value")
@@ -2620,7 +2620,7 @@ class AttributeAccessTest(fixtures.TestBase):
def test_resolved_to_correct_class_five(self):
Base = declarative_base()
- class Mixin(object):
+ class Mixin:
children = association_proxy("_children", "value")
class Parent(Mixin, Base):
@@ -2650,7 +2650,7 @@ class AttributeAccessTest(fixtures.TestBase):
foo._calc_owner(None, None)
is_(foo.owning_class, None)
- class Bat(object):
+ class Bat:
foo = association_proxy("x", "y")
Bat.foo
@@ -2677,7 +2677,7 @@ class AttributeAccessTest(fixtures.TestBase):
is_(Bat.foo.owning_class, Bat)
-class ScalarRemoveTest(object):
+class ScalarRemoveTest:
useobject = None
cascade_scalar_deletes = None
uselist = None
@@ -2938,7 +2938,7 @@ class InfoTest(fixtures.TestBase):
eq_(assoc.info, {})
def test_via_cls(self):
- class Foob(object):
+ class Foob:
assoc = association_proxy("a", "b")
eq_(Foob.assoc.info, {})
diff --git a/test/ext/test_baked.py b/test/ext/test_baked.py
index 977fb3639..c40ee3395 100644
--- a/test/ext/test_baked.py
+++ b/test/ext/test_baked.py
@@ -292,7 +292,7 @@ class LikeQueryTest(BakedTest):
def test_get_pk_w_null(self):
"""test the re-implementation of logic to do get with IS NULL."""
- class AddressUser(object):
+ class AddressUser:
pass
self.mapper_registry.map_imperatively(
diff --git a/test/ext/test_extendedattr.py b/test/ext/test_extendedattr.py
index c762754bc..43443b7f6 100644
--- a/test/ext/test_extendedattr.py
+++ b/test/ext/test_extendedattr.py
@@ -35,7 +35,7 @@ def modifies_instrumentation_finders(fn, *args, **kw):
instrumentation.instrumentation_finders.extend(pristine)
-class _ExtBase(object):
+class _ExtBase:
@classmethod
def teardown_test_class(cls):
instrumentation._reinstall_default_lookups()
@@ -107,7 +107,7 @@ class DisposeTest(_ExtBase, fixtures.TestBase):
return get
- class MyClass(object):
+ class MyClass:
__sa_instrumentation_manager__ = MyClassState
assert attributes.manager_of_class(MyClass) is None
@@ -139,12 +139,12 @@ class UserDefinedExtensionTest(_ExtBase, fixtures.ORMTest):
def setup_test_class(cls):
global MyBaseClass, MyClass
- class MyBaseClass(object):
+ class MyBaseClass:
__sa_instrumentation_manager__ = (
instrumentation.InstrumentationManager
)
- class MyClass(object):
+ class MyClass:
# This proves that a staticmethod will work here; don't
# flatten this back to a class assignment!
@@ -523,7 +523,7 @@ class UserDefinedExtensionTest(_ExtBase, fixtures.ORMTest):
def test_alternate_finders(self):
"""Ensure the generic finder front-end deals with edge cases."""
- class Unknown(object):
+ class Unknown:
pass
class Known(MyBaseClass):
@@ -569,7 +569,7 @@ class UserDefinedExtensionTest(_ExtBase, fixtures.ORMTest):
class FinderTest(_ExtBase, fixtures.ORMTest):
def test_standard(self):
- class A(object):
+ class A:
pass
register_class(A)
@@ -577,7 +577,7 @@ class FinderTest(_ExtBase, fixtures.ORMTest):
eq_(type(manager_of_class(A)), instrumentation.ClassManager)
def test_nativeext_interfaceexact(self):
- class A(object):
+ class A:
__sa_instrumentation_manager__ = (
instrumentation.InstrumentationManager
)
@@ -589,7 +589,7 @@ class FinderTest(_ExtBase, fixtures.ORMTest):
class Mine(instrumentation.ClassManager):
pass
- class A(object):
+ class A:
__sa_instrumentation_manager__ = Mine
register_class(A)
@@ -600,7 +600,7 @@ class FinderTest(_ExtBase, fixtures.ORMTest):
class Mine(instrumentation.ClassManager):
pass
- class A(object):
+ class A:
pass
def find(cls):
@@ -612,7 +612,7 @@ class FinderTest(_ExtBase, fixtures.ORMTest):
@modifies_instrumentation_finders
def test_customfinder_pass(self):
- class A(object):
+ class A:
pass
def find(cls):
@@ -626,7 +626,7 @@ class FinderTest(_ExtBase, fixtures.ORMTest):
class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
def test_none(self):
- class A(object):
+ class A:
pass
register_class(A)
@@ -634,18 +634,18 @@ class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
def mgr_factory(cls):
return instrumentation.ClassManager(cls)
- class B(object):
+ class B:
__sa_instrumentation_manager__ = staticmethod(mgr_factory)
register_class(B)
- class C(object):
+ class C:
__sa_instrumentation_manager__ = instrumentation.ClassManager
register_class(C)
def test_single_down(self):
- class A(object):
+ class A:
pass
register_class(A)
@@ -664,7 +664,7 @@ class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
)
def test_single_up(self):
- class A(object):
+ class A:
pass
# delay registration
@@ -688,7 +688,7 @@ class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
def mgr_factory(cls):
return instrumentation.ClassManager(cls)
- class A(object):
+ class A:
pass
class B1(A):
@@ -697,7 +697,7 @@ class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
class B2(A):
__sa_instrumentation_manager__ = staticmethod(mgr_factory)
- class C(object):
+ class C:
pass
assert_raises_message(
@@ -711,7 +711,7 @@ class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
def mgr_factory(cls):
return instrumentation.ClassManager(cls)
- class A(object):
+ class A:
pass
class B1(A):
@@ -720,7 +720,7 @@ class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
class B2(A):
__sa_instrumentation_manager__ = staticmethod(mgr_factory)
- class C(object):
+ class C:
pass
register_class(B2)
@@ -735,7 +735,7 @@ class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
def mgr_factory(cls):
return instrumentation.ClassManager(cls)
- class A(object):
+ class A:
pass
class B1(A):
@@ -744,7 +744,7 @@ class InstrumentationCollisionTest(_ExtBase, fixtures.ORMTest):
class B2(A):
__sa_instrumentation_manager__ = staticmethod(mgr_factory)
- class C(object):
+ class C:
pass
register_class(C)
@@ -773,7 +773,7 @@ class ExtendedEventsTest(_ExtBase, fixtures.ORMTest):
0, lambda cls: MyClassManager
)
- class A(object):
+ class A:
pass
register_class(A)
diff --git a/test/ext/test_horizontal_shard.py b/test/ext/test_horizontal_shard.py
index edc2711b6..e25e8c8ab 100644
--- a/test/ext/test_horizontal_shard.py
+++ b/test/ext/test_horizontal_shard.py
@@ -35,7 +35,7 @@ from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.testing.engines import testing_reaper
-class ShardTest(object):
+class ShardTest:
__skip_if__ = (lambda: util.win32,)
__requires__ = ("sqlite",)
@@ -152,12 +152,12 @@ class ShardTest(object):
def setup_mappers(cls):
global WeatherLocation, Report
- class WeatherLocation(object):
+ class WeatherLocation:
def __init__(self, continent, city):
self.continent = continent
self.city = city
- class Report(object):
+ class Report:
def __init__(self, temperature, id_=None):
self.temperature = temperature
if id_:
diff --git a/test/ext/test_hybrid.py b/test/ext/test_hybrid.py
index ad8d92b9b..f7524808f 100644
--- a/test/ext/test_hybrid.py
+++ b/test/ext/test_hybrid.py
@@ -137,7 +137,7 @@ class PropertyComparatorTest(fixtures.TestBase, AssertsCompiledSQL):
"""test :ticket:`6215`"""
Base = declarative_base()
- class SomeMixin(object):
+ class SomeMixin:
@hybrid.hybrid_property
def same_name(self):
return self.id
@@ -1163,7 +1163,7 @@ class SpecialObjectTest(fixtures.TestBase, AssertsCompiledSQL):
for currency_from, rate in zip(symbols, values)
)
- class Amount(object):
+ class Amount:
def __init__(self, amount, currency):
self.currency = currency
self.amount = amount
diff --git a/test/ext/test_mutable.py b/test/ext/test_mutable.py
index 1d88deb7a..6545d4545 100644
--- a/test/ext/test_mutable.py
+++ b/test/ext/test_mutable.py
@@ -41,7 +41,7 @@ class SubFoo(Foo):
pass
-class FooWithEq(object):
+class FooWithEq:
def __init__(self, **kw):
for k in kw:
setattr(self, k, kw[k])
@@ -91,7 +91,7 @@ class MyPoint(Point):
return value
-class _MutableDictTestFixture(object):
+class _MutableDictTestFixture:
@classmethod
def _type_fixture(cls):
return MutableDict
@@ -312,7 +312,7 @@ class _MutableDictTestBase(_MutableDictTestFixture):
eq_(f1.data, {"a": "b"})
-class _MutableListTestFixture(object):
+class _MutableListTestFixture:
@classmethod
def _type_fixture(cls):
return MutableList
@@ -618,7 +618,7 @@ class _MutableListTestBase(_MutableListTestFixture):
assert isinstance(obj, MutableList)
-class _MutableSetTestFixture(object):
+class _MutableSetTestFixture:
@classmethod
def _type_fixture(cls):
return MutableSet
@@ -853,7 +853,7 @@ class _MutableSetTestBase(_MutableSetTestFixture):
eq_(f1.data, set([1, 2]))
-class _MutableNoHashFixture(object):
+class _MutableNoHashFixture:
@testing.fixture(autouse=True, scope="class")
def set_class(self):
global Foo
@@ -1057,7 +1057,7 @@ class MutableColumnCopyArrayTest(_MutableListTestBase, fixtures.MappedTest):
Base = declarative_base(metadata=metadata)
- class Mixin(object):
+ class Mixin:
data = Column(MutableList.as_mutable(ARRAY(Integer)))
class Foo(Mixin, Base):
@@ -1279,7 +1279,7 @@ class CustomMutableAssociationScalarJSONTest(
eq_(type(f1.data), self._type_fixture())
-class _CompositeTestBase(object):
+class _CompositeTestBase:
@classmethod
def define_tables(cls, metadata):
Table(
diff --git a/test/ext/test_orderinglist.py b/test/ext/test_orderinglist.py
index 031613bc4..90c7f3857 100644
--- a/test/ext/test_orderinglist.py
+++ b/test/ext/test_orderinglist.py
@@ -91,14 +91,14 @@ class OrderingListTest(fixtures.MappedTest):
Column("text", String(128)),
)
- class Slide(object):
+ class Slide:
def __init__(self, name):
self.name = name
def __repr__(self):
return '<Slide "%s">' % self.name
- class Bullet(object):
+ class Bullet:
def __init__(self, text):
self.text = text
@@ -409,7 +409,7 @@ class OrderingListTest(fixtures.MappedTest):
eq_([b.position for b in s1.bullets], [0, 1, 2])
def test_funky_ordering(self):
- class Pos(object):
+ class Pos:
def __init__(self):
self.position = None
@@ -481,7 +481,7 @@ class OrderingListTest(fixtures.MappedTest):
self.assert_(copy.__dict__ == olist.__dict__)
-class DummyItem(object):
+class DummyItem:
def __init__(self, order=None):
self.order = order
diff --git a/test/orm/_fixtures.py b/test/orm/_fixtures.py
index 6715cb7fe..094568a37 100644
--- a/test/orm/_fixtures.py
+++ b/test/orm/_fixtures.py
@@ -396,7 +396,7 @@ class FixtureTest(fixtures.MappedTest):
return CannedResults(self)
-class CannedResults(object):
+class CannedResults:
"""Built on demand, instances use mappers in effect at time of call."""
def __init__(self, test):
diff --git a/test/orm/declarative/test_basic.py b/test/orm/declarative/test_basic.py
index 0e3a48458..f8cbdee36 100644
--- a/test/orm/declarative/test_basic.py
+++ b/test/orm/declarative/test_basic.py
@@ -191,7 +191,7 @@ class DeclarativeTest(DeclarativeTestBase):
def test_dispose_attrs(self):
reg = registry()
- class Foo(object):
+ class Foo:
__tablename__ = "some_table"
id = Column(Integer, primary_key=True)
@@ -213,7 +213,7 @@ class DeclarativeTest(DeclarativeTestBase):
)
def test_deferred_reflection_default_error(self):
- class MyExt(object):
+ class MyExt:
@classmethod
def prepare(cls):
"sample prepare method"
@@ -358,7 +358,7 @@ class DeclarativeTest(DeclarativeTestBase):
x = sa.sql.expression.column(Integer)
y = Column(Integer)
- class MyMixin(object):
+ class MyMixin:
x = sa.sql.expression.column(Integer)
y = Column(Integer)
@@ -393,7 +393,7 @@ class DeclarativeTest(DeclarativeTestBase):
r"non-schema 'sqlalchemy.sql.column\(\)' object; "
):
- class MyMixin2(object):
+ class MyMixin2:
@declared_attr
def x(cls):
return sa.sql.expression.column(Integer)
@@ -1198,7 +1198,7 @@ class DeclarativeTest(DeclarativeTestBase):
)
def test_custom_base(self):
- class MyBase(object):
+ class MyBase:
def foobar(self):
return "foobar"
@@ -1614,7 +1614,7 @@ class DeclarativeTest(DeclarativeTestBase):
def test_table_cls_attribute_return_none(self):
from sqlalchemy.schema import Column, PrimaryKeyConstraint
- class AutoTable(object):
+ class AutoTable:
@declared_attr
def __tablename__(cls):
return cls.__name__
@@ -2237,7 +2237,7 @@ class DeclarativeTest(DeclarativeTestBase):
)
def test_cls_docstring(self):
- class MyBase(object):
+ class MyBase:
"""MyBase Docstring"""
Base = declarative_base(cls=MyBase)
diff --git a/test/orm/declarative/test_clsregistry.py b/test/orm/declarative/test_clsregistry.py
index b9d41ee53..8c6381475 100644
--- a/test/orm/declarative/test_clsregistry.py
+++ b/test/orm/declarative/test_clsregistry.py
@@ -10,7 +10,7 @@ from sqlalchemy.testing import mock
from sqlalchemy.testing.util import gc_collect
-class MockClass(object):
+class MockClass:
def __init__(self, base, name):
self._sa_class_manager = mock.Mock(registry=base)
tokens = name.split(".")
@@ -19,7 +19,7 @@ class MockClass(object):
self.metadata = MetaData()
-class MockProp(object):
+class MockProp:
parent = "some_parent"
diff --git a/test/orm/declarative/test_deprecations.py b/test/orm/declarative/test_deprecations.py
index 7267a9aa2..0727baefd 100644
--- a/test/orm/declarative/test_deprecations.py
+++ b/test/orm/declarative/test_deprecations.py
@@ -45,7 +45,7 @@ class BoundMetadataDeclarativeTest(fixtures.MappedTest):
reg = registry(_bind=testing.db)
@reg.mapped
- class User(object):
+ class User:
__tablename__ = "user"
id = Column(Integer, primary_key=True)
diff --git a/test/orm/declarative/test_inheritance.py b/test/orm/declarative/test_inheritance.py
index 7e43e2559..ca3a6e608 100644
--- a/test/orm/declarative/test_inheritance.py
+++ b/test/orm/declarative/test_inheritance.py
@@ -308,7 +308,7 @@ class DeclarativeInheritanceTest(DeclarativeTestBase):
discriminator = Column("type", String(50))
__mapper_args__ = {"polymorphic_on": discriminator}
- class MyMixin(object):
+ class MyMixin:
pass
@@ -324,7 +324,7 @@ class DeclarativeInheritanceTest(DeclarativeTestBase):
assert class_mapper(Engineer).inherits is class_mapper(Person)
def test_intermediate_abstract_class_on_classical(self):
- class Person(object):
+ class Person:
pass
person_table = Table(
@@ -357,7 +357,7 @@ class DeclarativeInheritanceTest(DeclarativeTestBase):
eq_(set(class_mapper(Manager).class_manager), {"id", "kind"})
def test_intermediate_unmapped_class_on_classical(self):
- class Person(object):
+ class Person:
pass
person_table = Table(
@@ -390,7 +390,7 @@ class DeclarativeInheritanceTest(DeclarativeTestBase):
eq_(set(class_mapper(Manager).class_manager), {"id", "kind"})
def test_class_w_invalid_multiple_bases(self):
- class Person(object):
+ class Person:
pass
person_table = Table(
diff --git a/test/orm/declarative/test_mixin.py b/test/orm/declarative/test_mixin.py
index f3feb5ddf..3bad55d31 100644
--- a/test/orm/declarative/test_mixin.py
+++ b/test/orm/declarative/test_mixin.py
@@ -54,7 +54,7 @@ class DeclarativeTestBase(fixtures.TestBase, testing.AssertsExecutionResults):
class DeclarativeMixinTest(DeclarativeTestBase):
def test_simple_wbase(self):
- class MyMixin(object):
+ class MyMixin:
id = Column(
Integer, primary_key=True, test_needs_autoincrement=True
@@ -79,7 +79,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
eq_(obj.foo(), "bar1")
def test_simple_wdecorator(self):
- class MyMixin(object):
+ class MyMixin:
id = Column(
Integer, primary_key=True, test_needs_autoincrement=True
@@ -138,7 +138,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
eq_(obj.foo(), "bar1")
def test_unique_column(self):
- class MyMixin(object):
+ class MyMixin:
id = Column(Integer, primary_key=True)
value = Column(String, unique=True)
@@ -213,7 +213,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
def test_mixin_overrides_wbase(self):
"""test a mixin that overrides a column on a superclass."""
- class MixinA(object):
+ class MixinA:
foo = Column(String(50))
class MixinB(MixinA):
@@ -233,7 +233,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
def test_mixin_overrides_wdecorator(self):
"""test a mixin that overrides a column on a superclass."""
- class MixinA(object):
+ class MixinA:
foo = Column(String(50))
class MixinB(MixinA):
@@ -330,10 +330,10 @@ class DeclarativeMixinTest(DeclarativeTestBase):
reg = registry()
- class B1(object):
+ class B1:
metadata = m1
- class B2(object):
+ class B2:
metadata = m2
def fullname(self):
@@ -361,7 +361,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
username = Column(String)
@reg.mapped
- class BUser(object):
+ class BUser:
__tablename__ = "user"
id = Column(Integer, primary_key=True)
@@ -427,7 +427,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
eq_(MyModel.__table__.name, "mymodel")
def test_classproperty_still_works(self):
- class MyMixin(object):
+ class MyMixin:
@classproperty
def __tablename__(cls):
return cls.__name__.lower()
@@ -526,7 +526,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
"""
- class MyMixin(object):
+ class MyMixin:
foo = Column("foo", Integer)
bar = Column("bar_newname", Integer)
@@ -559,7 +559,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
__tablename__ = "person"
id = Column(Integer, primary_key=True)
- class Mixin(object):
+ class Mixin:
@declared_attr
def target_id(cls):
return cls.__table__.c.get(
@@ -607,7 +607,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
"""
- class MyMixin(object):
+ class MyMixin:
foo = Column("foo", Integer)
bar = Column("bar_newname", Integer)
@@ -685,7 +685,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
def test_declare_first_mixin(self):
canary = mock.Mock()
- class MyMixin(object):
+ class MyMixin:
@classmethod
def __declare_first__(cls):
canary.declare_first__(cls)
@@ -712,7 +712,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
def test_declare_first_base(self):
canary = mock.Mock()
- class MyMixin(object):
+ class MyMixin:
@classmethod
def __declare_first__(cls):
canary.declare_first__(cls)
@@ -969,7 +969,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
def test_mapper_args_custom_base(self):
"""test the @declared_attr approach from a custom base."""
- class Base(object):
+ class Base:
@declared_attr
def __tablename__(cls):
return cls.__name__.lower()
@@ -1087,7 +1087,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
eq_(Joined.__table__.kwargs, {"mysql_engine": "InnoDB"})
def test_col_copy_vs_declared_attr_joined_propagation(self):
- class Mixin(object):
+ class Mixin:
a = Column(Integer)
@declared_attr
@@ -1108,7 +1108,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
assert "b" not in B.__table__.c
def test_col_copy_vs_declared_attr_joined_propagation_newname(self):
- class Mixin(object):
+ class Mixin:
a = Column("a1", Integer)
@declared_attr
@@ -1129,7 +1129,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
assert "b1" not in B.__table__.c
def test_col_copy_vs_declared_attr_single_propagation(self):
- class Mixin(object):
+ class Mixin:
a = Column(Integer)
@declared_attr
@@ -1309,12 +1309,12 @@ class DeclarativeMixinTest(DeclarativeTestBase):
assert model_col.type.__class__ is Integer
def test_mixin_column_ordering(self):
- class Foo(object):
+ class Foo:
col1 = Column(Integer)
col3 = Column(Integer)
- class Bar(object):
+ class Bar:
col2 = Column(Integer)
col4 = Column(Integer)
@@ -1330,7 +1330,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
)
def test_honor_class_mro_one(self):
- class HasXMixin(object):
+ class HasXMixin:
@declared_attr
def x(self):
return Column(Integer)
@@ -1346,7 +1346,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
assert "x" not in Child.__table__.c
def test_honor_class_mro_two(self):
- class HasXMixin(object):
+ class HasXMixin:
@declared_attr
def x(self):
return Column(Integer)
@@ -1365,7 +1365,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
assert C().x() == "hi"
def test_arbitrary_attrs_one(self):
- class HasMixin(object):
+ class HasMixin:
@declared_attr
def some_attr(cls):
return cls.__name__ + "SOME ATTR"
@@ -1398,7 +1398,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
def __init__(self, filter_, **kw):
self.filter = filter_
- class FilterMixin(object):
+ class FilterMixin:
@declared_attr
def _filters(cls):
return relationship(
@@ -1490,7 +1490,7 @@ class DeclarativeMixinPropertyTest(
DeclarativeTestBase, testing.AssertsCompiledSQL
):
def test_column_property(self):
- class MyMixin(object):
+ class MyMixin:
@declared_attr
def prop_hoho(cls):
return column_property(Column("prop", String(50)))
@@ -1540,7 +1540,7 @@ class DeclarativeMixinPropertyTest(
"""
- class MyMixin(object):
+ class MyMixin:
@declared_attr
def type_(cls):
"""this is a document."""
@@ -1566,7 +1566,7 @@ class DeclarativeMixinPropertyTest(
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy import inspect
- class Mixin(object):
+ class Mixin:
@hybrid_property
def hp1(cls):
return 42
@@ -1604,7 +1604,7 @@ class DeclarativeMixinPropertyTest(
def test_correct_for_proxies_doesnt_impact_synonyms(self):
from sqlalchemy import inspect
- class Mixin(object):
+ class Mixin:
@declared_attr
def data_syn(cls):
return synonym("data")
@@ -1645,7 +1645,7 @@ class DeclarativeMixinPropertyTest(
)
def test_column_in_mapper_args(self):
- class MyMixin(object):
+ class MyMixin:
@declared_attr
def type_(cls):
return Column(String(50))
@@ -1663,7 +1663,7 @@ class DeclarativeMixinPropertyTest(
assert col.table is not None
def test_column_in_mapper_args_used_multiple_times(self):
- class MyMixin(object):
+ class MyMixin:
version_id = Column(Integer)
__mapper_args__ = {"version_id_col": version_id}
@@ -1686,7 +1686,7 @@ class DeclarativeMixinPropertyTest(
)
def test_deferred(self):
- class MyMixin(object):
+ class MyMixin:
@declared_attr
def data(cls):
return deferred(Column("data", String(50)))
@@ -1709,7 +1709,7 @@ class DeclarativeMixinPropertyTest(
assert "data" in d1.__dict__
def _test_relationship(self, usestring):
- class RefTargetMixin(object):
+ class RefTargetMixin:
@declared_attr
def target_id(cls):
return Column("target_id", ForeignKey("target.id"))
@@ -1774,7 +1774,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
def test_singleton_behavior_within_decl(self):
counter = mock.Mock()
- class Mixin(object):
+ class Mixin:
@declared_attr
def my_prop(cls):
counter(cls)
@@ -1824,7 +1824,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
def test_singleton_gc(self):
counter = mock.Mock()
- class Mixin(object):
+ class Mixin:
@declared_attr
def my_prop(cls):
counter(cls.__name__)
@@ -1851,7 +1851,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
)
def test_can_we_access_the_mixin_straight(self):
- class Mixin(object):
+ class Mixin:
@declared_attr
def my_prop(cls):
return Column("x", Integer)
@@ -1866,7 +1866,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
)
def test_can_we_access_the_mixin_straight_special_names(self):
- class Mixin(object):
+ class Mixin:
@declared_attr
def __table_args__(cls):
return (1, 2, 3)
@@ -1881,7 +1881,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
def test_non_decl_access(self):
counter = mock.Mock()
- class Mixin(object):
+ class Mixin:
@declared_attr
def __tablename__(cls):
counter(cls)
@@ -1914,7 +1914,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
def test_property_noncascade(self):
counter = mock.Mock()
- class Mixin(object):
+ class Mixin:
@declared_attr
def my_prop(cls):
counter(cls)
@@ -1934,7 +1934,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
def test_property_cascade_mixin(self):
counter = mock.Mock()
- class Mixin(object):
+ class Mixin:
@declared_attr.cascading
def my_prop(cls):
counter(cls)
@@ -1954,7 +1954,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
def test_property_cascade_mixin_override(self):
counter = mock.Mock()
- class Mixin(object):
+ class Mixin:
@declared_attr.cascading
def my_prop(cls):
counter(cls)
@@ -2000,7 +2000,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
eq_(counter.mock_calls, [mock.call(A), mock.call(B)])
def test_warn_cascading_used_w_tablename(self):
- class Mixin(object):
+ class Mixin:
@declared_attr.cascading
def __tablename__(cls):
return "foo"
@@ -2021,7 +2021,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
asserted = collections.defaultdict(set)
- class Mixin(object):
+ class Mixin:
@declared_attr.cascading
def my_attr(cls):
if has_inherited_table(cls):
@@ -2071,7 +2071,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
def test_column_pre_map(self):
counter = mock.Mock()
- class Mixin(object):
+ class Mixin:
@declared_attr
def my_col(cls):
counter(cls)
@@ -2092,7 +2092,7 @@ class DeclaredAttrTest(DeclarativeTestBase, testing.AssertsCompiledSQL):
counter = mock.Mock()
- class HasAddressCount(object):
+ class HasAddressCount:
id = Column(Integer, primary_key=True)
@declared_attr
@@ -2168,7 +2168,7 @@ class AbstractTest(DeclarativeTestBase):
def test_implicit_abstract_viadecorator(self):
@mapper_registry.mapped
- class A(object):
+ class A:
__tablename__ = "a"
id = Column(Integer, primary_key=True)
diff --git a/test/orm/inheritance/test_assorted_poly.py b/test/orm/inheritance/test_assorted_poly.py
index 729e1ee04..66a722ccf 100644
--- a/test/orm/inheritance/test_assorted_poly.py
+++ b/test/orm/inheritance/test_assorted_poly.py
@@ -249,7 +249,7 @@ class RelationshipTest2(fixtures.MappedTest):
if usedata:
- class Data(object):
+ class Data:
def __init__(self, data):
self.data = data
@@ -553,7 +553,7 @@ class RelationshipTest4(fixtures.MappedTest):
how to alias the primaryjoin to the polymorphic union ?"""
# class definitions
- class Person(object):
+ class Person:
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
@@ -572,7 +572,7 @@ class RelationshipTest4(fixtures.MappedTest):
self.longer_status,
)
- class Car(object):
+ class Car:
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
@@ -731,7 +731,7 @@ class RelationshipTest5(fixtures.MappedTest):
"""test parent object with child relationship to an inheriting mapper,
using eager loads, works when there are no child objects present"""
- class Person(object):
+ class Person:
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
@@ -750,7 +750,7 @@ class RelationshipTest5(fixtures.MappedTest):
self.longer_status,
)
- class Car(object):
+ class Car:
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
@@ -943,7 +943,7 @@ class RelationshipTest7(fixtures.MappedTest):
"""test that lazy load clause to a polymorphic child mapper generates
correctly [ticket:493]"""
- class PersistentObject(object):
+ class PersistentObject:
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
@@ -1535,7 +1535,7 @@ class MultiLevelTest(fixtures.MappedTest):
)
def test_threelevels(self):
- class Employee(object):
+ class Employee:
def set(me, **kargs):
for k, v in kargs.items():
setattr(me, k, v)
@@ -1666,13 +1666,13 @@ class ManyToManyPolyTest(fixtures.MappedTest):
aren't attempted to be matched to the target polymorphic
selectable"""
- class BaseItem(object):
+ class BaseItem:
pass
class Item(BaseItem):
pass
- class Collection(object):
+ class Collection:
pass
item_join = polymorphic_union(
@@ -1735,7 +1735,7 @@ class CustomPKTest(fixtures.MappedTest):
"""test that the primary_key attribute is propagated to the
polymorphic mapper"""
- class T1(object):
+ class T1:
pass
class T2(T1):
@@ -1783,7 +1783,7 @@ class CustomPKTest(fixtures.MappedTest):
"""test that a composite primary key attribute formed by a join
is "collapsed" into its minimal columns"""
- class T1(object):
+ class T1:
pass
class T2(T1):
diff --git a/test/orm/inheritance/test_basic.py b/test/orm/inheritance/test_basic.py
index ac1661fdd..339a6b956 100644
--- a/test/orm/inheritance/test_basic.py
+++ b/test/orm/inheritance/test_basic.py
@@ -76,7 +76,7 @@ class O2MTest(fixtures.MappedTest):
)
def test_basic(self):
- class Foo(object):
+ class Foo:
def __init__(self, data=None):
self.data = data
@@ -686,7 +686,7 @@ class FalseDiscriminatorTest(fixtures.MappedTest):
)
def test_false_on_sub(self):
- class Foo(object):
+ class Foo:
pass
class Bar(Foo):
@@ -707,7 +707,7 @@ class FalseDiscriminatorTest(fixtures.MappedTest):
assert isinstance(sess.query(Foo).one(), Bar)
def test_false_on_base(self):
- class Ding(object):
+ class Ding:
pass
class Bat(Ding):
@@ -1480,10 +1480,10 @@ class FlushTest(fixtures.MappedTest):
self.tables.user_roles,
)
- class User(object):
+ class User:
pass
- class Role(object):
+ class Role:
pass
class Admin(User):
@@ -1527,12 +1527,12 @@ class FlushTest(fixtures.MappedTest):
self.tables.user_roles,
)
- class User(object):
+ class User:
def __init__(self, email=None, password=None):
self.email = email
self.password = password
- class Role(object):
+ class Role:
def __init__(self, description=None):
self.description = description
@@ -2090,7 +2090,7 @@ class DistinctPKTest(fixtures.MappedTest):
Column("person_id", Integer, ForeignKey("persons.id")),
)
- class Person(object):
+ class Person:
def __init__(self, name):
self.name = name
@@ -2231,7 +2231,7 @@ class SyncCompileTest(fixtures.MappedTest):
j1 = testing.resolve_lambda(j1, **locals())
j2 = testing.resolve_lambda(j2, **locals())
- class A(object):
+ class A:
def __init__(self, **kwargs):
for key, value in list(kwargs.items()):
setattr(self, key, value)
@@ -2310,7 +2310,7 @@ class OverrideColKeyTest(fixtures.MappedTest):
def test_plain(self):
# control case
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -2331,7 +2331,7 @@ class OverrideColKeyTest(fixtures.MappedTest):
# in particular, here we do a "manual" version of
# what we'd like the mapper to do.
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -2364,7 +2364,7 @@ class OverrideColKeyTest(fixtures.MappedTest):
assert sess.get(Sub, 10) is s1
def test_override_onlyinparent(self):
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -2403,7 +2403,7 @@ class OverrideColKeyTest(fixtures.MappedTest):
# this is originally [ticket:1111].
# the pattern here is now disallowed by [ticket:1892]
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -2428,7 +2428,7 @@ class OverrideColKeyTest(fixtures.MappedTest):
assert_raises(sa_exc.InvalidRequestError, go)
def test_pk_fk_different(self):
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -2452,7 +2452,7 @@ class OverrideColKeyTest(fixtures.MappedTest):
"""test that descriptors prevent inheritance from propagating
properties to subclasses."""
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -2473,13 +2473,13 @@ class OverrideColKeyTest(fixtures.MappedTest):
"""test that descriptors prevent inheritance from propagating
properties to subclasses."""
- class MyDesc(object):
+ class MyDesc:
def __get__(self, instance, owner):
if instance is None:
return self
return "im the data"
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -2495,7 +2495,7 @@ class OverrideColKeyTest(fixtures.MappedTest):
assert sess.query(Sub).one().data == "im the data"
def test_sub_columns_over_base_descriptors(self):
- class Base(object):
+ class Base:
@property
def subdata(self):
return "this is base"
@@ -2521,7 +2521,7 @@ class OverrideColKeyTest(fixtures.MappedTest):
assert sess.get(Sub, s1.base_id).subdata == "this is sub"
def test_base_descriptors_over_base_cols(self):
- class Base(object):
+ class Base:
@property
def data(self):
return "this is base"
@@ -2814,7 +2814,7 @@ class OptimizedLoadTest(fixtures.MappedTest):
class WithComp(Base):
pass
- class Comp(object):
+ class Comp:
def __init__(self, a, b):
self.a = a
self.b = b
@@ -3022,7 +3022,7 @@ class NoPKOnSubTableWarningTest(fixtures.MappedTest):
def test_warning_on_sub(self):
parent, child = self._fixture()
- class P(object):
+ class P:
pass
class C(P):
@@ -3042,7 +3042,7 @@ class NoPKOnSubTableWarningTest(fixtures.MappedTest):
def test_no_warning_with_explicit(self):
parent, child = self._fixture()
- class P(object):
+ class P:
pass
class C(P):
@@ -3068,7 +3068,7 @@ class InhCondTest(fixtures.MappedTest):
Column("owner_id", Integer, ForeignKey("owner.owner_id")),
)
- class Base(object):
+ class Base:
pass
class Derived(Base):
@@ -3094,7 +3094,7 @@ class InhCondTest(fixtures.MappedTest):
)
Table("order", m, Column("id", Integer, primary_key=True))
- class Base(object):
+ class Base:
pass
class Derived(Base):
@@ -3119,7 +3119,7 @@ class InhCondTest(fixtures.MappedTest):
"derived", metadata, Column("id", Integer, primary_key=True)
)
- class Base(object):
+ class Base:
pass
class Derived(Base):
@@ -3154,7 +3154,7 @@ class InhCondTest(fixtures.MappedTest):
Column("id", Integer, ForeignKey("base.id"), primary_key=True),
)
- class Base(object):
+ class Base:
pass
class Derived(Base):
@@ -3183,7 +3183,7 @@ class InhCondTest(fixtures.MappedTest):
Column("id", Integer, ForeignKey("base.id"), primary_key=True),
)
- class Base(object):
+ class Base:
pass
class Derived(Base):
@@ -3216,7 +3216,7 @@ class InhCondTest(fixtures.MappedTest):
Column("id", Integer, ForeignKey("base.q"), primary_key=True),
)
- class Base(object):
+ class Base:
pass
class Derived(Base):
@@ -3260,11 +3260,11 @@ class PKDiscriminatorTest(fixtures.MappedTest):
def test_pk_as_discriminator(self):
parents, children = self.tables.parents, self.tables.children
- class Parent(object):
+ class Parent:
def __init__(self, name=None):
self.name = name
- class Child(object):
+ class Child:
def __init__(self, name=None):
self.name = name
@@ -3732,7 +3732,7 @@ class NameConflictTest(fixtures.MappedTest):
)
def test_name_conflict(self):
- class Content(object):
+ class Content:
pass
class Foo(Content):
diff --git a/test/orm/inheritance/test_concrete.py b/test/orm/inheritance/test_concrete.py
index d9dfa3d9e..fae146755 100644
--- a/test/orm/inheritance/test_concrete.py
+++ b/test/orm/inheritance/test_concrete.py
@@ -1400,7 +1400,7 @@ class ColKeysTest(fixtures.MappedTest):
"pjoin",
)
- class Location(object):
+ class Location:
pass
class Refugee(Location):
diff --git a/test/orm/inheritance/test_manytomany.py b/test/orm/inheritance/test_manytomany.py
index 60acab87d..e366a349c 100644
--- a/test/orm/inheritance/test_manytomany.py
+++ b/test/orm/inheritance/test_manytomany.py
@@ -76,7 +76,7 @@ class InheritTest(fixtures.MappedTest):
)
def test_basic(self):
- class Principal(object):
+ class Principal:
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
@@ -151,7 +151,7 @@ class InheritTest2(fixtures.MappedTest):
)
def test_get(self):
- class Foo(object):
+ class Foo:
def __init__(self, data=None):
self.data = data
@@ -173,7 +173,7 @@ class InheritTest2(fixtures.MappedTest):
assert sess.get(Bar, b.id).id == b.id
def test_basic(self):
- class Foo(object):
+ class Foo:
def __init__(self, data=None):
self.data = data
@@ -281,7 +281,7 @@ class InheritTest3(fixtures.MappedTest):
)
def test_basic(self):
- class Foo(object):
+ class Foo:
def __init__(self, data=None):
self.data = data
@@ -317,7 +317,7 @@ class InheritTest3(fixtures.MappedTest):
eq_(found, compare)
def test_advanced(self):
- class Foo(object):
+ class Foo:
def __init__(self, data=None):
self.data = data
diff --git a/test/orm/inheritance/test_poly_linked_list.py b/test/orm/inheritance/test_poly_linked_list.py
index ef3466ddf..a501e027a 100644
--- a/test/orm/inheritance/test_poly_linked_list.py
+++ b/test/orm/inheritance/test_poly_linked_list.py
@@ -71,7 +71,7 @@ class PolymorphicCircularTest(fixtures.MappedTest):
join = table1.outerjoin(table2).outerjoin(table3).alias("pjoin")
# join = None
- class Table1(object):
+ class Table1:
def __init__(self, name, data=None):
self.name = name
if data is not None:
@@ -94,7 +94,7 @@ class PolymorphicCircularTest(fixtures.MappedTest):
class Table3(Table1):
pass
- class Data(object):
+ class Data:
def __init__(self, data):
self.data = data
diff --git a/test/orm/inheritance/test_poly_loading.py b/test/orm/inheritance/test_poly_loading.py
index 00537a1fc..fcaf470b4 100644
--- a/test/orm/inheritance/test_poly_loading.py
+++ b/test/orm/inheritance/test_poly_loading.py
@@ -32,7 +32,7 @@ from ._poly_fixtures import Manager
from ._poly_fixtures import Person
-class BaseAndSubFixture(object):
+class BaseAndSubFixture:
use_options = False
@classmethod
diff --git a/test/orm/inheritance/test_productspec.py b/test/orm/inheritance/test_productspec.py
index cede0cbb5..d7d8b9ec5 100644
--- a/test/orm/inheritance/test_productspec.py
+++ b/test/orm/inheritance/test_productspec.py
@@ -85,7 +85,7 @@ class InheritTest(fixtures.MappedTest):
Column("size", Integer, default=0),
)
- class Product(object):
+ class Product:
def __init__(self, name, mark=""):
self.name = name
self.mark = mark
@@ -110,7 +110,7 @@ class InheritTest(fixtures.MappedTest):
)
)
- class SpecLine(object):
+ class SpecLine:
def __init__(self, leader=None, follower=None, quantity=1):
self.leader = leader
self.follower = follower
@@ -123,7 +123,7 @@ class InheritTest(fixtures.MappedTest):
repr(self.follower),
)
- class Document(object):
+ class Document:
def __init__(self, name, data=None):
self.name = name
self.data = data
diff --git a/test/orm/test_attributes.py b/test/orm/test_attributes.py
index 130e98078..4d0a1b03c 100644
--- a/test/orm/test_attributes.py
+++ b/test/orm/test_attributes.py
@@ -37,10 +37,10 @@ def _set_callable(state, dict_, key, callable_):
class AttributeImplAPITest(fixtures.MappedTest):
def _scalar_obj_fixture(self):
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
instrumentation.register_class(A)
@@ -49,10 +49,10 @@ class AttributeImplAPITest(fixtures.MappedTest):
return A, B
def _collection_obj_fixture(self):
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
instrumentation.register_class(A)
@@ -212,10 +212,10 @@ class AttributesTest(fixtures.ORMTest):
def setup_test(self):
global MyTest, MyTest2
- class MyTest(object):
+ class MyTest:
pass
- class MyTest2(object):
+ class MyTest2:
pass
def teardown_test(self):
@@ -223,7 +223,7 @@ class AttributesTest(fixtures.ORMTest):
MyTest, MyTest2 = None, None
def test_basic(self):
- class User(object):
+ class User:
pass
instrumentation.register_class(User)
@@ -325,7 +325,7 @@ class AttributesTest(fixtures.ORMTest):
"""test that InstanceState always has a dict, even after host
object gc'ed."""
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -340,10 +340,10 @@ class AttributesTest(fixtures.ORMTest):
@testing.requires.predictable_gc
def test_object_dereferenced_error(self):
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
def __init__(self):
gc_collect()
@@ -362,7 +362,7 @@ class AttributesTest(fixtures.ORMTest):
)
def test_unmapped_instance_raises(self):
- class User(object):
+ class User:
pass
instrumentation.register_class(User)
@@ -370,7 +370,7 @@ class AttributesTest(fixtures.ORMTest):
User, "user_name", uselist=False, useobject=False
)
- class Blog(object):
+ class Blog:
name = User.user_name
def go():
@@ -383,7 +383,7 @@ class AttributesTest(fixtures.ORMTest):
)
def test_del_scalar_nonobject(self):
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -408,10 +408,10 @@ class AttributesTest(fixtures.ORMTest):
)
def test_del_scalar_object(self):
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -435,10 +435,10 @@ class AttributesTest(fixtures.ORMTest):
)
def test_del_collection_object(self):
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -458,7 +458,7 @@ class AttributesTest(fixtures.ORMTest):
eq_(f1.b, [])
def test_deferred(self):
- class Foo(object):
+ class Foo:
pass
data = {"a": "this is a", "b": 12}
@@ -535,10 +535,10 @@ class AttributesTest(fixtures.ORMTest):
eq_(m2.b, 12)
def test_list(self):
- class User(object):
+ class User:
pass
- class Address(object):
+ class Address:
pass
instrumentation.register_class(User)
@@ -602,10 +602,10 @@ class AttributesTest(fixtures.ORMTest):
"""
- class Post(object):
+ class Post:
pass
- class Blog(object):
+ class Blog:
pass
instrumentation.register_class(Post)
@@ -665,10 +665,10 @@ class AttributesTest(fixtures.ORMTest):
assert attributes.has_parent(Post, b2, "blog")
def test_illegal_trackparent(self):
- class Post(object):
+ class Post:
pass
- class Blog(object):
+ class Blog:
pass
instrumentation.register_class(Post)
@@ -695,7 +695,7 @@ class AttributesTest(fixtures.ORMTest):
def test_inheritance(self):
"""tests that attributes are polymorphic"""
- class Foo(object):
+ class Foo:
pass
class Bar(Foo):
@@ -733,7 +733,7 @@ class AttributesTest(fixtures.ORMTest):
def test_no_double_state(self):
states = set()
- class Foo(object):
+ class Foo:
def __init__(self):
states.add(attributes.instance_state(self))
@@ -754,13 +754,13 @@ class AttributesTest(fixtures.ORMTest):
managed attributes of an object, if the object is of a
descendant class with managed attributes in the parent class"""
- class Foo(object):
+ class Foo:
pass
class Bar(Foo):
pass
- class Element(object):
+ class Element:
_state = True
instrumentation.register_class(Foo)
@@ -819,10 +819,10 @@ class AttributesTest(fixtures.ORMTest):
)
def test_parenttrack(self):
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -862,18 +862,18 @@ class AttributesTest(fixtures.ORMTest):
from ones implementing zope.interface.Interface). This is a
simple regression test to prevent that defect."""
- class des(object):
+ class des:
def __get__(self, instance, owner):
raise AttributeError("fake attribute")
- class Foo(object):
+ class Foo:
A = des()
instrumentation.register_class(Foo)
instrumentation.unregister_class(Foo)
def test_collectionclasses(self):
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -920,7 +920,7 @@ class AttributesTest(fixtures.ORMTest):
assert isinstance(Foo().collection, MyDict)
attributes.unregister_attribute(Foo, "collection")
- class MyColl(object):
+ class MyColl:
pass
try:
@@ -938,7 +938,7 @@ class AttributesTest(fixtures.ORMTest):
"collection class"
)
- class MyColl(object):
+ class MyColl:
@collection.iterator
def __iter__(self):
return iter([])
@@ -965,7 +965,7 @@ class AttributesTest(fixtures.ORMTest):
assert False
def test_last_known_tracking(self):
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -1013,10 +1013,10 @@ class AttributesTest(fixtures.ORMTest):
class GetNoValueTest(fixtures.ORMTest):
def _fixture(self, expected):
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
def lazy_callable(state, passive):
@@ -1083,10 +1083,10 @@ class GetNoValueTest(fixtures.ORMTest):
class UtilTest(fixtures.ORMTest):
def test_helpers(self):
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -1114,10 +1114,10 @@ class UtilTest(fixtures.ORMTest):
"""test that set_committed_value->None to a uselist generates an
empty list"""
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -1137,10 +1137,10 @@ class UtilTest(fixtures.ORMTest):
eq_(f1.col_set, set())
def test_initiator_arg(self):
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -1173,10 +1173,10 @@ class UtilTest(fixtures.ORMTest):
class BackrefTest(fixtures.ORMTest):
def test_m2m(self):
- class Student(object):
+ class Student:
pass
- class Course(object):
+ class Course:
pass
instrumentation.register_class(Student)
@@ -1208,10 +1208,10 @@ class BackrefTest(fixtures.ORMTest):
self.assert_(c.students == [s2, s3])
def test_o2m(self):
- class Post(object):
+ class Post:
pass
- class Blog(object):
+ class Blog:
pass
instrumentation.register_class(Post)
@@ -1256,10 +1256,10 @@ class BackrefTest(fixtures.ORMTest):
del p5.blog
def test_o2o(self):
- class Port(object):
+ class Port:
pass
- class Jack(object):
+ class Jack:
pass
instrumentation.register_class(Port)
@@ -1290,10 +1290,10 @@ class BackrefTest(fixtures.ORMTest):
"""
- class Parent(object):
+ class Parent:
pass
- class Child(object):
+ class Child:
pass
class SubChild(Child):
@@ -1338,13 +1338,13 @@ class BackrefTest(fixtures.ORMTest):
c2.parent = p1
def test_symmetric_o2m_inheritance(self):
- class Parent(object):
+ class Parent:
pass
class SubParent(Parent):
pass
- class Child(object):
+ class Child:
pass
p_token = object()
@@ -1431,13 +1431,13 @@ class CyclicBackrefAssertionTest(fixtures.TestBase):
)
def _scalar_fixture(self):
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
- class C(object):
+ class C:
pass
instrumentation.register_class(A)
@@ -1456,13 +1456,13 @@ class CyclicBackrefAssertionTest(fixtures.TestBase):
return A, B, C
def _collection_fixture(self):
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
- class C(object):
+ class C:
pass
instrumentation.register_class(A)
@@ -1482,10 +1482,10 @@ class CyclicBackrefAssertionTest(fixtures.TestBase):
return A, B, C
def _broken_collection_fixture(self):
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
instrumentation.register_class(A)
@@ -1519,7 +1519,7 @@ class CyclicBackrefAssertionTest(fixtures.TestBase):
class PendingBackrefTest(fixtures.ORMTest):
def _fixture(self):
- class Post(object):
+ class Post:
def __init__(self, name):
self.name = name
@@ -1528,7 +1528,7 @@ class PendingBackrefTest(fixtures.ORMTest):
def __eq__(self, other):
return other is not None and other.name == self.name
- class Blog(object):
+ class Blog:
def __init__(self, name):
self.name = name
@@ -3237,10 +3237,10 @@ class ListenerTest(fixtures.ORMTest):
def test_receive_changes(self):
"""test that Listeners can mutate the given value."""
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
def append(state, child, initiator):
@@ -3282,10 +3282,10 @@ class ListenerTest(fixtures.ORMTest):
def test_named(self):
canary = Mock()
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -3335,10 +3335,10 @@ class ListenerTest(fixtures.ORMTest):
)
def test_collection_link_events(self):
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -3380,10 +3380,10 @@ class ListenerTest(fixtures.ORMTest):
"""
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -3423,7 +3423,7 @@ class ListenerTest(fixtures.ORMTest):
def test_flag_modified(self):
canary = Mock()
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -3441,7 +3441,7 @@ class ListenerTest(fixtures.ORMTest):
def test_none_init_scalar(self):
canary = Mock()
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -3457,7 +3457,7 @@ class ListenerTest(fixtures.ORMTest):
def test_none_init_object(self):
canary = Mock()
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -3473,10 +3473,10 @@ class ListenerTest(fixtures.ORMTest):
def test_none_init_collection(self):
canary = Mock()
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
instrumentation.register_class(Foo)
@@ -3584,7 +3584,7 @@ class EventPropagateTest(fixtures.TestBase):
canary = []
def make_a():
- class A(object):
+ class A:
pass
classes[0] = A
@@ -3602,7 +3602,7 @@ class EventPropagateTest(fixtures.TestBase):
classes[2] = C
def make_d():
- class D(object):
+ class D:
pass
classes[3] = D
@@ -3691,10 +3691,10 @@ class EventPropagateTest(fixtures.TestBase):
class CollectionInitTest(fixtures.TestBase):
def setup_test(self):
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
self.A = A
@@ -3750,10 +3750,10 @@ class CollectionInitTest(fixtures.TestBase):
class TestUnlink(fixtures.TestBase):
def setup_test(self):
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
self.A = A
diff --git a/test/orm/test_cache_key.py b/test/orm/test_cache_key.py
index 7fb232b0b..5ed856a3c 100644
--- a/test/orm/test_cache_key.py
+++ b/test/orm/test_cache_key.py
@@ -134,7 +134,7 @@ class CacheKeyTest(CacheKeyFixture, _fixtures.FixtureTest):
from sqlalchemy import Column, Integer, String
- class Foo(object):
+ class Foo:
id = Column(Integer)
name = Column(String)
@@ -152,7 +152,7 @@ class CacheKeyTest(CacheKeyFixture, _fixtures.FixtureTest):
def test_loader_criteria_bound_param_thing(self):
from sqlalchemy import Column, Integer
- class Foo(object):
+ class Foo:
id = Column(Integer)
def go(param):
diff --git a/test/orm/test_cascade.py b/test/orm/test_cascade.py
index 3617e3a5d..c64c5a03a 100644
--- a/test/orm/test_cascade.py
+++ b/test/orm/test_cascade.py
@@ -3593,14 +3593,14 @@ class OrphanCriterionTest(fixtures.MappedTest):
r2_present,
detach_event=True,
):
- class Core(object):
+ class Core:
pass
- class RelatedOne(object):
+ class RelatedOne:
def __init__(self, cores):
self.cores = cores
- class RelatedTwo(object):
+ class RelatedTwo:
def __init__(self, cores):
self.cores = cores
@@ -4492,7 +4492,7 @@ class CollectionCascadesNoBackrefTest(fixtures.TestBase):
def cascade_fixture(self, registry):
def go(collection_class):
@registry.mapped
- class A(object):
+ class A:
__tablename__ = "a"
id = Column(Integer, primary_key=True)
@@ -4504,7 +4504,7 @@ class CollectionCascadesNoBackrefTest(fixtures.TestBase):
)
@registry.mapped
- class B(object):
+ class B:
__tablename__ = "b_"
id = Column(Integer, primary_key=True)
a_id = Column(ForeignKey("a.id"))
diff --git a/test/orm/test_collection.py b/test/orm/test_collection.py
index 90bb606cb..ca14d7658 100644
--- a/test/orm/test_collection.py
+++ b/test/orm/test_collection.py
@@ -27,7 +27,7 @@ from sqlalchemy.testing.schema import Column
from sqlalchemy.testing.schema import Table
-class Canary(object):
+class Canary:
def __init__(self):
self.data = set()
self.added = set()
@@ -77,14 +77,14 @@ class Canary(object):
return value
-class OrderedDictFixture(object):
+class OrderedDictFixture:
@testing.fixture
def ordered_dict_mro(self):
return type("ordered", (collections.MappedCollection,), {})
class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
- class Entity(object):
+ class Entity:
def __init__(self, a=None, b=None, c=None):
self.a = a
self.b = b
@@ -117,7 +117,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.entity_maker
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -170,7 +170,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.entity_maker
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -206,7 +206,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.entity_maker
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -451,7 +451,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.entity_maker
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -525,7 +525,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
# or __delslice__ methods. The __setitem__
# and __delitem__ must therefore accept
# slice objects (i.e. as in py3k)
- class ListLike(object):
+ class ListLike:
def __init__(self):
self.data = list()
@@ -581,7 +581,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
self.assert_(getattr(MyList, "_sa_instrumented") == id(MyList))
def test_list_duck(self):
- class ListLike(object):
+ class ListLike:
def __init__(self):
self.data = list()
@@ -617,7 +617,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
self.assert_(getattr(ListLike, "_sa_instrumented") == id(ListLike))
def test_list_emulates(self):
- class ListIsh(object):
+ class ListIsh:
__emulates__ = list
def __init__(self):
@@ -658,7 +658,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.entity_maker
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -700,7 +700,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.entity_maker
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -968,7 +968,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.entity_maker
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -1032,7 +1032,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
self.assert_(getattr(MySet, "_sa_instrumented") == id(MySet))
def test_set_duck(self):
- class SetLike(object):
+ class SetLike:
def __init__(self):
self.data = set()
@@ -1068,7 +1068,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
self.assert_(getattr(SetLike, "_sa_instrumented") == id(SetLike))
def test_set_emulates(self):
- class SetIsh(object):
+ class SetIsh:
__emulates__ = set
def __init__(self):
@@ -1109,7 +1109,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.dictable_entity
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -1170,7 +1170,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.dictable_entity
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -1298,7 +1298,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.dictable_entity
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -1421,7 +1421,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
self.assert_(getattr(MyOrdered, "_sa_instrumented") == id(MyOrdered))
def test_dict_duck(self):
- class DictLike(object):
+ class DictLike:
def __init__(self):
self.data = dict()
@@ -1472,7 +1472,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
self.assert_(getattr(DictLike, "_sa_instrumented") == id(DictLike))
def test_dict_emulates(self):
- class DictIsh(object):
+ class DictIsh:
__emulates__ = dict
def __init__(self):
@@ -1528,7 +1528,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
if creator is None:
creator = self.entity_maker
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -1579,7 +1579,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
assert_eq()
def test_object_duck(self):
- class MyCollection(object):
+ class MyCollection:
def __init__(self):
self.data = set()
@@ -1613,7 +1613,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
)
def test_object_emulates(self):
- class MyCollection2(object):
+ class MyCollection2:
__emulates__ = None
def __init__(self):
@@ -1654,7 +1654,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
)
def test_recipes(self):
- class Custom(object):
+ class Custom:
def __init__(self):
self.data = []
@@ -1689,7 +1689,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
def __iter__(self):
return iter(self.data)
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -1762,7 +1762,7 @@ class CollectionsTest(OrderedDictFixture, fixtures.ORMTest):
self.assert_(dr3 is cr3)
def test_lifecycle(self):
- class Foo(object):
+ class Foo:
pass
canary = Canary()
@@ -2176,10 +2176,10 @@ class CustomCollectionsTest(fixtures.MappedTest):
class MyList(list):
pass
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
self.mapper_registry.map_imperatively(
@@ -2199,10 +2199,10 @@ class CustomCollectionsTest(fixtures.MappedTest):
self.tables.sometable,
)
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
self.mapper_registry.map_imperatively(
@@ -2230,10 +2230,10 @@ class CustomCollectionsTest(fixtures.MappedTest):
self.tables.sometable,
)
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
class AppenderDict(dict):
@@ -2274,10 +2274,10 @@ class CustomCollectionsTest(fixtures.MappedTest):
self.tables.sometable,
)
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
def __init__(self, data):
self.data = data
@@ -2324,7 +2324,7 @@ class CustomCollectionsTest(fixtures.MappedTest):
self._test_list(list)
def test_list_no_setslice(self):
- class ListLike(object):
+ class ListLike:
def __init__(self):
self.data = list()
@@ -2374,10 +2374,10 @@ class CustomCollectionsTest(fixtures.MappedTest):
self.tables.sometable,
)
- class Parent(object):
+ class Parent:
pass
- class Child(object):
+ class Child:
pass
self.mapper_registry.map_imperatively(
@@ -2505,13 +2505,13 @@ class CustomCollectionsTest(fixtures.MappedTest):
self.tables.sometable,
)
- class Parent(object):
+ class Parent:
pass
- class Child(object):
+ class Child:
pass
- class MyCollection(object):
+ class MyCollection:
def __init__(self):
self.data = []
@@ -2566,7 +2566,7 @@ class CustomCollectionsTest(fixtures.MappedTest):
class InstrumentationTest(fixtures.ORMTest):
def test_uncooperative_descriptor_in_sweep(self):
- class DoNotTouch(object):
+ class DoNotTouch:
def __get__(self, obj, owner):
raise AttributeError
@@ -2580,7 +2580,7 @@ class InstrumentationTest(fixtures.ORMTest):
collections._instrument_class(Touchy)
def test_referenced_by_owner(self):
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
diff --git a/test/orm/test_compile.py b/test/orm/test_compile.py
index 343881efc..edf726f3c 100644
--- a/test/orm/test_compile.py
+++ b/test/orm/test_compile.py
@@ -63,16 +63,16 @@ class CompileTest(fixtures.MappedTest):
),
)
- class Order(object):
+ class Order:
pass
- class Employee(object):
+ class Employee:
pass
- class Product(object):
+ class Product:
pass
- class OrderProduct(object):
+ class OrderProduct:
pass
order_join = order.select().alias("pjoin")
@@ -148,13 +148,13 @@ class CompileTest(fixtures.MappedTest):
),
)
- class Order(object):
+ class Order:
pass
- class Product(object):
+ class Product:
pass
- class OrderProduct(object):
+ class OrderProduct:
pass
order_join = order.select().alias("pjoin")
@@ -212,13 +212,13 @@ class CompileTest(fixtures.MappedTest):
metadata.create_all(connection)
connection.execute(node_table.insert(), dict(node_id=1, node_index=5))
- class Node(object):
+ class Node:
pass
- class NodeName(object):
+ class NodeName:
pass
- class Host(object):
+ class Host:
pass
self.mapper_registry.map_imperatively(Node, node_table)
@@ -245,10 +245,10 @@ class CompileTest(fixtures.MappedTest):
Column("a_id", Integer, ForeignKey("a.id")),
)
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
self.mapper_registry.map_imperatively(
@@ -273,10 +273,10 @@ class CompileTest(fixtures.MappedTest):
Column("a_id", Integer, ForeignKey("a.id")),
)
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
class C(B):
diff --git a/test/orm/test_composites.py b/test/orm/test_composites.py
index 55a78ffcb..67ffae75d 100644
--- a/test/orm/test_composites.py
+++ b/test/orm/test_composites.py
@@ -442,7 +442,7 @@ class NestedTest(fixtures.MappedTest, testing.AssertsCompiledSQL):
)
def _fixture(self):
- class AB(object):
+ class AB:
def __init__(self, a, b, cd):
self.a = a
self.b = b
@@ -466,7 +466,7 @@ class NestedTest(fixtures.MappedTest, testing.AssertsCompiledSQL):
def __ne__(self, other):
return not self.__eq__(other)
- class CD(object):
+ class CD:
def __init__(self, c, d):
self.c = c
self.d = d
@@ -484,7 +484,7 @@ class NestedTest(fixtures.MappedTest, testing.AssertsCompiledSQL):
def __ne__(self, other):
return not self.__eq__(other)
- class Thing(object):
+ class Thing:
def __init__(self, ab):
self.ab = ab
diff --git a/test/orm/test_core_compilation.py b/test/orm/test_core_compilation.py
index 5d66e339a..4bf196fa0 100644
--- a/test/orm/test_core_compilation.py
+++ b/test/orm/test_core_compilation.py
@@ -2290,7 +2290,7 @@ class RawSelectTest(QueryTest, AssertsCompiledSQL):
)
def test_col_prop_builtin_function(self):
- class Foo(object):
+ class Foo:
pass
self.mapper_registry.map_imperatively(
diff --git a/test/orm/test_deprecations.py b/test/orm/test_deprecations.py
index 5fd876474..962161f7b 100644
--- a/test/orm/test_deprecations.py
+++ b/test/orm/test_deprecations.py
@@ -2870,7 +2870,7 @@ class DeprecatedMapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
__dialect__ = "default"
def test_deferred_scalar_loader_name_change(self):
- class Foo(object):
+ class Foo:
pass
def myloader(*arg, **kw):
@@ -3108,7 +3108,7 @@ class InstrumentationTest(fixtures.ORMTest):
for key, value in dictlike.items():
yield value + 5
- class Foo(object):
+ class Foo:
pass
instrumentation.register_class(Foo)
@@ -3128,7 +3128,7 @@ class InstrumentationTest(fixtures.ORMTest):
"AttributeEvents"
):
- class Base(object):
+ class Base:
@collection.iterator
def base_iterate(self, x):
return "base_iterate"
@@ -3602,7 +3602,7 @@ class NonPrimaryMapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
def test_illegal_non_primary_3(self):
users, addresses = self.tables.users, self.tables.addresses
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -3668,7 +3668,7 @@ class NonPrimaryMapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
def test_illegal_non_primary_3_legacy(self):
users, addresses = self.tables.users, self.tables.addresses
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -4331,7 +4331,7 @@ class DeclarativeBind(fixtures.TestBase):
):
@as_declarative(bind=testing.db)
- class Base(object):
+ class Base:
@declared_attr
def __tablename__(cls):
return cls.__name__.lower()
@@ -5995,10 +5995,10 @@ class MultiplePathTest(fixtures.MappedTest, AssertsCompiledSQL):
self.tables.t1,
)
- class T1(object):
+ class T1:
pass
- class T2(object):
+ class T2:
pass
self.mapper_registry.map_imperatively(
@@ -6037,7 +6037,7 @@ class BindSensitiveStringifyTest(fixtures.MappedTest):
# building a totally separate metadata /mapping here
# because we need to control if the MetaData is bound or not
- class User(object):
+ class User:
pass
m = MetaData()
@@ -8369,7 +8369,7 @@ class CollectionCascadesDespiteBackrefTest(fixtures.TestBase):
def cascade_fixture(self, registry):
def go(collection_class):
@registry.mapped
- class A(object):
+ class A:
__tablename__ = "a"
id = Column(Integer, primary_key=True)
@@ -8378,7 +8378,7 @@ class CollectionCascadesDespiteBackrefTest(fixtures.TestBase):
)
@registry.mapped
- class B(object):
+ class B:
__tablename__ = "b_"
id = Column(Integer, primary_key=True)
a_id = Column(ForeignKey("a.id"))
diff --git a/test/orm/test_dynamic.py b/test/orm/test_dynamic.py
index e037ef191..5ea613197 100644
--- a/test/orm/test_dynamic.py
+++ b/test/orm/test_dynamic.py
@@ -24,7 +24,7 @@ from sqlalchemy.testing.fixtures import fixture_session
from test.orm import _fixtures
-class _DynamicFixture(object):
+class _DynamicFixture:
def _user_address_fixture(self, addresses_args={}):
users, Address, addresses, User = (
self.tables.users,
@@ -628,7 +628,7 @@ class DynamicTest(_DynamicFixture, _fixtures.FixtureTest, AssertsCompiledSQL):
)
item_keywords = self.tables.item_keywords
- class ItemKeyword(object):
+ class ItemKeyword:
pass
self.mapper_registry.map_imperatively(
diff --git a/test/orm/test_eager_relations.py b/test/orm/test_eager_relations.py
index 32abc3b31..9cefb51cb 100644
--- a/test/orm/test_eager_relations.py
+++ b/test/orm/test_eager_relations.py
@@ -5408,13 +5408,13 @@ class CyclicalInheritingEagerTestOne(fixtures.MappedTest):
def test_basic(self):
t2, t1 = self.tables.t2, self.tables.t1
- class T(object):
+ class T:
pass
class SubT(T):
pass
- class T2(object):
+ class T2:
pass
class SubT2(T2):
diff --git a/test/orm/test_events.py b/test/orm/test_events.py
index 39d1e8ad9..aa17f2b6c 100644
--- a/test/orm/test_events.py
+++ b/test/orm/test_events.py
@@ -48,7 +48,7 @@ from sqlalchemy.testing.util import gc_collect
from test.orm import _fixtures
-class _RemoveListeners(object):
+class _RemoveListeners:
@testing.fixture(autouse=True)
def _remove_listeners(self):
yield
@@ -645,7 +645,7 @@ class MapperEventsTest(_RemoveListeners, _fixtures.FixtureTest):
canary = []
- class A(object):
+ class A:
pass
class B(A):
@@ -734,7 +734,7 @@ class MapperEventsTest(_RemoveListeners, _fixtures.FixtureTest):
def test_init_failure_hook(self):
users = self.tables.users
- class Thing(object):
+ class Thing:
def __init__(self, **kw):
if kw.get("fail"):
raise Exception("failure")
@@ -1122,7 +1122,7 @@ class MapperEventsTest(_RemoveListeners, _fixtures.FixtureTest):
def test_instrument_class_precedes_class_instrumentation(self):
users = self.tables.users
- class MyClass(object):
+ class MyClass:
pass
class MySubClass(MyClass):
@@ -1693,7 +1693,7 @@ class DeferredMapperEventsTest(_RemoveListeners, _fixtures.FixtureTest):
def test_isolation_instrument_event(self):
User = self.classes.User
- class Bar(object):
+ class Bar:
pass
canary = []
@@ -1710,7 +1710,7 @@ class DeferredMapperEventsTest(_RemoveListeners, _fixtures.FixtureTest):
@testing.requires.predictable_gc
def test_instrument_event_auto_remove(self):
- class Bar(object):
+ class Bar:
pass
dispatch = instrumentation._instrumentation_factory.dispatch
@@ -1858,7 +1858,7 @@ class RemovalTest(_fixtures.FixtureTest):
def test_unmapped_listen(self):
users = self.tables.users
- class Foo(object):
+ class Foo:
pass
fn = Mock()
@@ -1894,7 +1894,7 @@ class RemovalTest(_fixtures.FixtureTest):
fn = Mock()
- class User(object):
+ class User:
pass
event.listen(User, "load", fn)
@@ -2130,7 +2130,7 @@ class SessionEventsTest(_RemoveListeners, _fixtures.FixtureTest):
def my_listener_one(*arg, **kw):
pass
- class NotASession(object):
+ class NotASession:
def __call__(self):
return fixture_session()
diff --git a/test/orm/test_inspect.py b/test/orm/test_inspect.py
index 0917544cb..f468fc5c2 100644
--- a/test/orm/test_inspect.py
+++ b/test/orm/test_inspect.py
@@ -65,7 +65,7 @@ class TestORMInspection(_fixtures.FixtureTest):
assert not insp.is_aliased_class
def test_mapper_selectable_fixed(self):
- class Foo(object):
+ class Foo:
pass
class Bar(Foo):
@@ -96,7 +96,7 @@ class TestORMInspection(_fixtures.FixtureTest):
assert insp.is_aliased_class
def test_not_mapped_class(self):
- class Foo(object):
+ class Foo:
pass
assert_raises_message(
@@ -107,7 +107,7 @@ class TestORMInspection(_fixtures.FixtureTest):
)
def test_not_mapped_instance(self):
- class Foo(object):
+ class Foo:
pass
assert_raises_message(
@@ -408,7 +408,7 @@ class TestORMInspection(_fixtures.FixtureTest):
class Thing(InspectionAttr):
pass
- class AnonClass(object):
+ class AnonClass:
__foo__ = "bar"
__bat__ = Thing()
@@ -548,7 +548,7 @@ class %s(SuperCls):
)
def test_all_orm_descriptors_pep520_classical(self):
- class MyClass(object):
+ class MyClass:
pass
from sqlalchemy import Table, MetaData, Column, Integer
diff --git a/test/orm/test_instrumentation.py b/test/orm/test_instrumentation.py
index 9158b5115..6b999f9f8 100644
--- a/test/orm/test_instrumentation.py
+++ b/test/orm/test_instrumentation.py
@@ -44,7 +44,7 @@ class InitTest(fixtures.ORMTest):
def test_ai(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -54,7 +54,7 @@ class InitTest(fixtures.ORMTest):
def test_A(self):
inits = []
- class A(object):
+ class A:
pass
self.register(A, inits)
@@ -65,7 +65,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -77,7 +77,7 @@ class InitTest(fixtures.ORMTest):
def test_ai_B(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -97,7 +97,7 @@ class InitTest(fixtures.ORMTest):
def test_ai_Bi(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -119,7 +119,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai_bi(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -141,7 +141,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai_Bi(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -165,7 +165,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai_B(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -187,7 +187,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai_Bi_Ci(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -230,7 +230,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai_bi_Ci(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -271,7 +271,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai_b_Ci(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -302,7 +302,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai_B_Ci(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -335,7 +335,7 @@ class InitTest(fixtures.ORMTest):
def test_Ai_B_C(self):
inits = []
- class A(object):
+ class A:
def __init__(self):
inits.append((A, "__init__"))
@@ -366,7 +366,7 @@ class InitTest(fixtures.ORMTest):
def test_A_Bi_C(self):
inits = []
- class A(object):
+ class A:
pass
self.register(A, inits)
@@ -397,7 +397,7 @@ class InitTest(fixtures.ORMTest):
def test_A_B_Ci(self):
inits = []
- class A(object):
+ class A:
pass
self.register(A, inits)
@@ -428,7 +428,7 @@ class InitTest(fixtures.ORMTest):
def test_A_B_C(self):
inits = []
- class A(object):
+ class A:
pass
self.register(A, inits)
@@ -456,7 +456,7 @@ class InitTest(fixtures.ORMTest):
eq_(inits, [(C, "init", C)])
def test_defaulted_init(self):
- class X(object):
+ class X:
def __init__(self_, a, b=123, c="abc"):
self_.a = a
self_.b = b
@@ -469,10 +469,10 @@ class InitTest(fixtures.ORMTest):
eq_(o.b, 123)
eq_(o.c, "abc")
- class Y(object):
+ class Y:
unique = object()
- class OutOfScopeForEval(object):
+ class OutOfScopeForEval:
def __repr__(self_):
# misleading repr
return "123"
@@ -502,7 +502,7 @@ class MapperInitTest(fixtures.MappedTest):
)
def test_partially_mapped_inheritance(self):
- class A(object):
+ class A:
pass
class B(A):
@@ -521,7 +521,7 @@ class MapperInitTest(fixtures.MappedTest):
assert_raises(sa.orm.exc.UnmappedClassError, class_mapper, C)
def test_del_warning(self):
- class A(object):
+ class A:
def __del__(self):
pass
@@ -546,7 +546,7 @@ class OnLoadTest(fixtures.ORMTest):
global A
- class A(object):
+ class A:
pass
def canary(instance):
@@ -566,7 +566,7 @@ class OnLoadTest(fixtures.ORMTest):
class NativeInstrumentationTest(fixtures.MappedTest):
def test_register_reserved_attribute(self):
- class T(object):
+ class T:
pass
instrumentation.register_class(T)
@@ -593,7 +593,7 @@ class NativeInstrumentationTest(fixtures.MappedTest):
Column(instrumentation.ClassManager.STATE_ATTR, Integer),
)
- class T(object):
+ class T:
pass
assert_raises(KeyError, self.mapper_registry.map_imperatively, T, t)
@@ -606,7 +606,7 @@ class NativeInstrumentationTest(fixtures.MappedTest):
Column(instrumentation.ClassManager.MANAGER_ATTR, Integer),
)
- class T(object):
+ class T:
pass
assert_raises(KeyError, self.mapper_registry.map_imperatively, T, t)
@@ -661,7 +661,7 @@ if util.py3k:
exec(
"""
def _kw_only_fixture(self):
- class A(object):
+ class A:
def __init__(self, a, *, b, c):
self.a = a
self.b = b
@@ -669,7 +669,7 @@ def _kw_only_fixture(self):
return self._instrument(A)
def _kw_plus_posn_fixture(self):
- class A(object):
+ class A:
def __init__(self, a, *args, b, c):
self.a = a
self.b = b
@@ -677,7 +677,7 @@ def _kw_plus_posn_fixture(self):
return self._instrument(A)
def _kw_opt_fixture(self):
- class A(object):
+ class A:
def __init__(self, a, *, b, c="c"):
self.a = a
self.b = b
@@ -701,7 +701,7 @@ class MiscTest(fixtures.MappedTest):
Column("x", Integer),
)
- class A(object):
+ class A:
pass
self.mapper_registry.map_imperatively(A, t)
@@ -724,10 +724,10 @@ class MiscTest(fixtures.MappedTest):
Column("t1_id", Integer, ForeignKey("t1.id")),
)
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
self.mapper_registry.map_imperatively(
@@ -739,7 +739,7 @@ class MiscTest(fixtures.MappedTest):
assert not a.bs
def test_uninstrument(self):
- class A(object):
+ class A:
pass
manager = instrumentation.register_class(A)
@@ -767,7 +767,7 @@ class MiscTest(fixtures.MappedTest):
Column("t1_id", Integer, ForeignKey("t1.id")),
)
- class Base(object):
+ class Base:
def __init__(self, *args, **kwargs):
pass
@@ -810,11 +810,11 @@ class MiscTest(fixtures.MappedTest):
Column("t1_id", Integer, ForeignKey("t1.id")),
)
- class Base(object):
+ class Base:
def __init__(self):
pass
- class Base_AKW(object):
+ class Base_AKW:
def __init__(self, *args, **kwargs):
pass
diff --git a/test/orm/test_joins.py b/test/orm/test_joins.py
index b9f036b1f..988fad662 100644
--- a/test/orm/test_joins.py
+++ b/test/orm/test_joins.py
@@ -2086,7 +2086,7 @@ class CreateJoinsTest(fixtures.MappedTest, AssertsCompiledSQL):
Column("id", Integer, ForeignKey("base.id"), primary_key=True),
)
- class Base(object):
+ class Base:
pass
class A(Base):
diff --git a/test/orm/test_lambdas.py b/test/orm/test_lambdas.py
index 5274271d9..53766c434 100644
--- a/test/orm/test_lambdas.py
+++ b/test/orm/test_lambdas.py
@@ -151,7 +151,7 @@ class LambdaTest(QueryTest, AssertsCompiledSQL):
if use_indirect_access:
def query(names):
- class Foo(object):
+ class Foo:
def __init__(self):
self.u1 = aliased(User)
diff --git a/test/orm/test_lazy_relations.py b/test/orm/test_lazy_relations.py
index 3ebff5f43..7f2292986 100644
--- a/test/orm/test_lazy_relations.py
+++ b/test/orm/test_lazy_relations.py
@@ -806,7 +806,7 @@ class LazyTest(_fixtures.FixtureTest):
"""
@registry.mapped
- class A(object):
+ class A:
__tablename__ = "a"
id = Column(Integer, primary_key=True)
@@ -815,7 +815,7 @@ class LazyTest(_fixtures.FixtureTest):
b = relationship("B")
@registry.mapped
- class B(object):
+ class B:
__tablename__ = "b"
id = Column(Integer, primary_key=True)
diff --git a/test/orm/test_mapper.py b/test/orm/test_mapper.py
index ec1ef3796..073f48119 100644
--- a/test/orm/test_mapper.py
+++ b/test/orm/test_mapper.py
@@ -167,7 +167,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
from sqlalchemy.orm.base import _is_mapped_class, _is_aliased_class
- class Foo(object):
+ class Foo:
x = "something"
@property
@@ -206,7 +206,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
from sqlalchemy.orm.base import _entity_descriptor
- class Foo(object):
+ class Foo:
x = "something"
@property
@@ -386,11 +386,11 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
users, addresses = self.tables.users, self.tables.addresses
- class Foo(object):
+ class Foo:
def __init__(self):
pass
- class Bar(object):
+ class Bar:
pass
self.mapper(Foo, users)
@@ -406,7 +406,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
"""
- class Foo(object):
+ class Foo:
def __init__(self, id_):
self.id = id_
@@ -547,7 +547,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
def test_class_hier_only_instrument_once_multiple_configure(self):
users, addresses = (self.tables.users, self.tables.addresses)
- class A(object):
+ class A:
pass
class ASub(A):
@@ -556,7 +556,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
class ASubSub(ASub):
pass
- class B(object):
+ class B:
pass
from sqlalchemy.testing import mock
@@ -630,7 +630,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
users = self.tables.users
Address = self.classes.Address
- class MyComposite(object):
+ class MyComposite:
pass
for constructor, args in [
@@ -899,7 +899,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
assert_calls = []
- class Address(object):
+ class Address:
def _get_user(self):
assert_calls.append("get")
return self._user
@@ -941,7 +941,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
Column("parent_id", Integer, ForeignKey("nodes.id")),
)
- class Node(object):
+ class Node:
pass
self.mapper(
@@ -1000,7 +1000,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
Column("vendor_id", Integer),
)
- class Person(object):
+ class Person:
pass
class Vendor(Person):
@@ -1012,23 +1012,23 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
class Manager(Employee):
pass
- class Hoho(object):
+ class Hoho:
pass
- class Lala(object):
+ class Lala:
pass
- class Fub(object):
+ class Fub:
pass
- class Frob(object):
+ class Frob:
pass
- class HasDef(object):
+ class HasDef:
def name(self):
pass
- class Empty(object):
+ class Empty:
pass
self.mapper(
@@ -1170,7 +1170,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
t.create(connection)
- class A(object):
+ class A:
pass
self.mapper(A, t, include_properties=["id"])
@@ -1179,7 +1179,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
s.commit()
def test_we_dont_call_bool(self):
- class NoBoolAllowed(object):
+ class NoBoolAllowed:
def __bool__(self):
raise Exception("nope")
@@ -1192,7 +1192,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
assert s.get(NoBoolAllowed, u1.id) is u1
def test_we_dont_call_eq(self):
- class NoEqAllowed(object):
+ class NoEqAllowed:
def __eq__(self, other):
raise Exception("nope")
@@ -1571,7 +1571,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
class extendedproperty(property):
attribute = 123
- class User(object):
+ class User:
def _get_name(self):
assert_col.append(("get", self.name))
return self.name
@@ -1669,7 +1669,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
# synonym points to non-existent attrbute that hasn't been mapped yet.
users = self.tables.users
- class User(object):
+ class User:
def _x(self):
return self.id
@@ -1691,7 +1691,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
assert hasattr(User.x, "comparator")
def test_synonym_of_non_property_raises(self):
- class User(object):
+ class User:
@property
def x(self):
return "hi"
@@ -1756,7 +1756,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
assert_col = []
- class User(object):
+ class User:
def _get_name(self):
assert_col.append(("get", self._name))
return self._name
@@ -1886,7 +1886,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
recon = []
- class User(object):
+ class User:
@reconstructor
def reconstruct(self):
recon.append("go")
@@ -1903,7 +1903,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
recon = []
- class A(object):
+ class A:
@reconstructor
def reconstruct(self):
assert isinstance(self, A)
@@ -1944,7 +1944,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
recon = []
- class User(object):
+ class User:
@reconstructor
def __init__(self):
recon.append("go")
@@ -1965,11 +1965,11 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
recon = []
- class recon_obj(object):
+ class recon_obj:
def __call__(self, obj):
recon.append("go")
- class User(object):
+ class User:
__init__ = reconstructor(recon_obj())
self.mapper(User, users)
@@ -1993,19 +1993,19 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
recon = []
- class recon_obj(object):
+ class recon_obj:
def __call__(self, obj):
recon.append("go")
__sa_reconstructor__ = True
- class recon_meth(object):
+ class recon_meth:
__func__ = recon_obj()
def __call__(self, *arg, **kw):
return self.__func__.__call__(*arg, **kw)
- class User(object):
+ class User:
__init__ = recon_meth()
self.mapper(User, users)
@@ -2022,7 +2022,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
recon = []
- class A(object):
+ class A:
@reconstructor
def __init__(self):
assert isinstance(self, A)
@@ -2063,7 +2063,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
recon = []
- class Base(object):
+ class Base:
@reconstructor
def reconstruct(self):
recon.append("go")
@@ -2163,7 +2163,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
def test_unmapped_subclass_error_postmap(self):
users = self.tables.users
- class Base(object):
+ class Base:
pass
class Sub(Base):
@@ -2186,7 +2186,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
def test_unmapped_subclass_error_premap(self):
users = self.tables.users
- class Base(object):
+ class Base:
pass
self.mapper(Base, users)
@@ -2213,7 +2213,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
class OldStyle:
pass
- class NewStyle(object):
+ class NewStyle:
pass
class A(NewStyle, OldStyle):
@@ -2277,7 +2277,7 @@ class RequirementsTest(fixtures.MappedTest):
Column("value", String(10)),
)
- class _ValueBase(object):
+ class _ValueBase:
def __init__(self, value="abc", id_=None):
self.id = id_
self.value = value
@@ -2456,7 +2456,7 @@ class RequirementsTest(fixtures.MappedTest):
def test_nonzero_len_recursion(self):
ht1 = self.tables.ht1
- class H1(object):
+ class H1:
def __len__(self):
return len(self.get_value())
@@ -2464,7 +2464,7 @@ class RequirementsTest(fixtures.MappedTest):
self.value = "foobar"
return self.value
- class H2(object):
+ class H2:
def __bool__(self):
return bool(self.get_value())
@@ -2495,7 +2495,7 @@ class IsUserlandTest(fixtures.MappedTest):
)
def _test(self, value, instancelevel=None):
- class Foo(object):
+ class Foo:
someprop = value
m = self.mapper(Foo, self.tables.foo)
@@ -2508,7 +2508,7 @@ class IsUserlandTest(fixtures.MappedTest):
assert self.tables.foo.c.someprop not in m._columntoproperty
def _test_not(self, value):
- class Foo(object):
+ class Foo:
someprop = value
m = self.mapper(Foo, self.tables.foo)
@@ -2632,7 +2632,7 @@ class MagicNamesTest(fixtures.MappedTest):
Column(reserved, Integer),
)
- class T(object):
+ class T:
pass
clear_mappers()
@@ -2655,7 +2655,7 @@ class MagicNamesTest(fixtures.MappedTest):
sa.orm.instrumentation.ClassManager.MANAGER_ATTR,
):
- class M(object):
+ class M:
pass
clear_mappers()
@@ -2705,10 +2705,10 @@ class DocumentTest(fixtures.TestBase):
),
)
- class Foo(object):
+ class Foo:
pass
- class Bar(object):
+ class Bar:
pass
self.mapper(
@@ -2767,7 +2767,7 @@ class ComparatorFactoryTest(_fixtures.FixtureTest, AssertsCompiledSQL):
def test_kwarg_accepted(self):
users, Address = self.tables.users, self.classes.Address
- class DummyComposite(object):
+ class DummyComposite:
def __init__(self, x, y):
pass
@@ -2937,18 +2937,18 @@ class RegistryConfigDisposeTest(fixtures.TestBase):
ab = bc = True
@reg1.mapped
- class A(object):
+ class A:
__tablename__ = "a"
id = Column(Integer, primary_key=True)
@reg2.mapped
- class B(object):
+ class B:
__tablename__ = "b"
id = Column(Integer, primary_key=True)
a_id = Column(ForeignKey(A.id))
@reg3.mapped
- class C(object):
+ class C:
__tablename__ = "c"
id = Column(Integer, primary_key=True)
b_id = Column(ForeignKey(B.id))
diff --git a/test/orm/test_merge.py b/test/orm/test_merge.py
index bc7914027..8866223cc 100644
--- a/test/orm/test_merge.py
+++ b/test/orm/test_merge.py
@@ -1399,7 +1399,7 @@ class MergeTest(_fixtures.FixtureTest):
def test_synonym(self):
users = self.tables.users
- class User(object):
+ class User:
def _getValue(self):
return self._value
diff --git a/test/orm/test_of_type.py b/test/orm/test_of_type.py
index 09b3cf51c..934803244 100644
--- a/test/orm/test_of_type.py
+++ b/test/orm/test_of_type.py
@@ -30,7 +30,7 @@ from .inheritance._poly_fixtures import Manager
from .inheritance._poly_fixtures import Person
-class _PolymorphicTestBase(object):
+class _PolymorphicTestBase:
__dialect__ = "default"
def test_any_one(self):
diff --git a/test/orm/test_options.py b/test/orm/test_options.py
index 1a2a5ba70..dcb210329 100644
--- a/test/orm/test_options.py
+++ b/test/orm/test_options.py
@@ -75,7 +75,7 @@ class QueryTest(_fixtures.FixtureTest):
)
-class PathTest(object):
+class PathTest:
def _make_path(self, path):
r = []
for i, item in enumerate(path):
diff --git a/test/orm/test_pickled.py b/test/orm/test_pickled.py
index 11d90bd59..2072b60e3 100644
--- a/test/orm/test_pickled.py
+++ b/test/orm/test_pickled.py
@@ -600,7 +600,7 @@ class PickleTest(fixtures.MappedTest):
pickle.loads(pickle.dumps(screen2))
def test_exceptions(self):
- class Foo(object):
+ class Foo:
pass
users = self.tables.users
diff --git a/test/orm/test_query.py b/test/orm/test_query.py
index 5c17cdaef..5bbe150c0 100644
--- a/test/orm/test_query.py
+++ b/test/orm/test_query.py
@@ -1005,7 +1005,7 @@ class RowLabelingTest(QueryTest):
@testing.fixture
def uname_fixture(self):
- class Foo(object):
+ class Foo:
pass
if False:
@@ -1341,7 +1341,7 @@ class GetTest(QueryTest):
def test_unique_param_names(self):
users = self.tables.users
- class SomeUser(object):
+ class SomeUser:
pass
s = users.select().where(users.c.id != 12).alias("users")
@@ -7714,7 +7714,7 @@ class QueryClsTest(QueryTest):
return MyQuery
def _callable_fixture(self):
- class MyQueryFactory(object):
+ class MyQueryFactory:
def __call__(self, *arg, **kw):
return Query(*arg, **kw)
diff --git a/test/orm/test_rel_fn.py b/test/orm/test_rel_fn.py
index 6f6b0d56d..dfce8e382 100644
--- a/test/orm/test_rel_fn.py
+++ b/test/orm/test_rel_fn.py
@@ -24,7 +24,7 @@ from sqlalchemy.testing import is_
from sqlalchemy.testing import mock
-class _JoinFixtures(object):
+class _JoinFixtures:
@classmethod
def setup_test_class(cls):
m = MetaData()
diff --git a/test/orm/test_relationship_criteria.py b/test/orm/test_relationship_criteria.py
index 7e2c6e04f..b2c16da05 100644
--- a/test/orm/test_relationship_criteria.py
+++ b/test/orm/test_relationship_criteria.py
@@ -104,7 +104,7 @@ class _Fixtures(_fixtures.FixtureTest):
def mixin_fixture(self):
users = self.tables.users
- class HasFoob(object):
+ class HasFoob:
name = Column(String)
class UserWFoob(HasFoob, self.Comparable):
@@ -120,7 +120,7 @@ class _Fixtures(_fixtures.FixtureTest):
def declattr_mixin_fixture(self):
users = self.tables.users
- class HasFoob(object):
+ class HasFoob:
@declared_attr
def name(cls):
return Column(String)
@@ -139,7 +139,7 @@ class _Fixtures(_fixtures.FixtureTest):
orders, items = self.tables.orders, self.tables.items
order_items = self.tables.order_items
- class HasFoob(object):
+ class HasFoob:
description = Column(String)
class HasBat(HasFoob):
@@ -894,7 +894,7 @@ class LoaderCriteriaTest(_Fixtures, testing.AssertsCompiledSQL):
class TemporalFixtureTest(testing.fixtures.DeclarativeMappedTest):
@classmethod
def setup_classes(cls):
- class HasTemporal(object):
+ class HasTemporal:
"""Mixin that identifies a class as having a timestamp column"""
timestamp = Column(
diff --git a/test/orm/test_relationships.py b/test/orm/test_relationships.py
index 98de9abad..94e74992f 100644
--- a/test/orm/test_relationships.py
+++ b/test/orm/test_relationships.py
@@ -47,7 +47,7 @@ from sqlalchemy.testing.schema import Table
from test.orm import _fixtures
-class _RelationshipErrors(object):
+class _RelationshipErrors:
def _assert_raises_no_relevant_fks(
self, fn, expr, relname, primary, *arg, **kw
):
@@ -2516,10 +2516,10 @@ class JoinConditionErrorTest(fixtures.TestBase):
)
t2 = Table("t2", m, Column("id", Integer, primary_key=True))
- class C1(object):
+ class C1:
pass
- class C2(object):
+ class C2:
pass
registry.map_imperatively(
@@ -2577,10 +2577,10 @@ class JoinConditionErrorTest(fixtures.TestBase):
Column("t1id", Integer, ForeignKey("t1.id")),
)
- class C1(object):
+ class C1:
pass
- class C2(object):
+ class C2:
pass
registry.map_imperatively(C1, t1, properties={"c2": relationship(C2)})
@@ -2599,10 +2599,10 @@ class JoinConditionErrorTest(fixtures.TestBase):
Column("t1id", Integer),
)
- class C1(object):
+ class C1:
pass
- class C2(object):
+ class C2:
pass
registry.map_imperatively(C1, t1, properties={"c2": relationship(C2)})
@@ -3507,10 +3507,10 @@ class ViewOnlyLocalRemoteM2M(fixtures.TestBase):
Column("t2_id", Integer, ForeignKey("t2.id")),
)
- class A(object):
+ class A:
pass
- class B(object):
+ class B:
pass
registry.map_imperatively(B, t2)
@@ -5558,7 +5558,7 @@ class ActiveHistoryFlagTest(_fixtures.FixtureTest):
def test_composite_property_flag(self):
Order, orders = self.classes.Order, self.tables.orders
- class MyComposite(object):
+ class MyComposite:
def __init__(self, description, isopen):
self.description = description
self.isopen = isopen
diff --git a/test/orm/test_session.py b/test/orm/test_session.py
index e31acf024..c11897ea5 100644
--- a/test/orm/test_session.py
+++ b/test/orm/test_session.py
@@ -970,7 +970,7 @@ class SessionStateTest(_fixtures.FixtureTest):
sess = fixture_session()
- class Foo(object):
+ class Foo:
def __init__(self):
sess.add(self)
@@ -1988,7 +1988,7 @@ class SessionInterface(fixtures.MappedTest):
# flush will no-op without something in the unit of work
def _():
- class OK(object):
+ class OK:
pass
self._map_it(OK)
@@ -2058,7 +2058,7 @@ class SessionInterface(fixtures.MappedTest):
)
def test_unmapped_instance(self):
- class Unmapped(object):
+ class Unmapped:
pass
self._test_instance_guards(Unmapped())
@@ -2070,14 +2070,14 @@ class SessionInterface(fixtures.MappedTest):
self._test_class_guards(prim, is_class=False)
def test_unmapped_class_for_instance(self):
- class Unmapped(object):
+ class Unmapped:
pass
self._test_instance_guards(Unmapped)
self._test_class_guards(Unmapped)
def test_mapped_class_for_instance(self):
- class Mapped(object):
+ class Mapped:
pass
self._map_it(Mapped)
@@ -2086,7 +2086,7 @@ class SessionInterface(fixtures.MappedTest):
# no class guards- it would pass.
def test_missing_state(self):
- class Mapped(object):
+ class Mapped:
pass
early = Mapped()
@@ -2096,7 +2096,7 @@ class SessionInterface(fixtures.MappedTest):
self._test_class_guards(early, is_class=False)
def test_refresh_arg_signature(self):
- class Mapped(object):
+ class Mapped:
pass
self._map_it(Mapped)
diff --git a/test/orm/test_subquery_relations.py b/test/orm/test_subquery_relations.py
index 5be0042b0..e07da638f 100644
--- a/test/orm/test_subquery_relations.py
+++ b/test/orm/test_subquery_relations.py
@@ -2831,13 +2831,13 @@ class CyclicalInheritingEagerTestOne(fixtures.MappedTest):
def test_basic(self):
t2, t1 = self.tables.t2, self.tables.t1
- class T(object):
+ class T:
pass
class SubT(T):
pass
- class T2(object):
+ class T2:
pass
class SubT2(T2):
diff --git a/test/orm/test_sync.py b/test/orm/test_sync.py
index 924ae674e..796ad84f9 100644
--- a/test/orm/test_sync.py
+++ b/test/orm/test_sync.py
@@ -14,7 +14,7 @@ from sqlalchemy.testing.schema import Column
from sqlalchemy.testing.schema import Table
-class AssertsUOW(object):
+class AssertsUOW:
def _get_test_uow(self, session):
uow = unitofwork.UOWTransaction(session)
deleted = set(session._deleted)
diff --git a/test/orm/test_transaction.py b/test/orm/test_transaction.py
index fa16d269a..3574c4507 100644
--- a/test/orm/test_transaction.py
+++ b/test/orm/test_transaction.py
@@ -2455,7 +2455,7 @@ class NaturalPKRollbackTest(fixtures.MappedTest):
assert s.identity_map[identity_key(User, ("u1",))] is u1
-class JoinIntoAnExternalTransactionFixture(object):
+class JoinIntoAnExternalTransactionFixture:
"""Test the "join into an external transaction" examples"""
__leave_connections_for_teardown__ = True
@@ -2512,7 +2512,7 @@ class NewStyleJoinIntoAnExternalTransactionTest(
# begin a non-ORM transaction
self.trans = self.connection.begin()
- class A(object):
+ class A:
pass
clear_mappers()
@@ -2579,7 +2579,7 @@ class LegacyJoinIntoAnExternalTransactionTest(
# begin a non-ORM transaction
self.trans = self.connection.begin()
- class A(object):
+ class A:
pass
# TODO: py2 is not hitting this correctly for some reason,
diff --git a/test/orm/test_unitofwork.py b/test/orm/test_unitofwork.py
index d3afab326..4ae842c4b 100644
--- a/test/orm/test_unitofwork.py
+++ b/test/orm/test_unitofwork.py
@@ -37,7 +37,7 @@ from sqlalchemy.util import ue
from test.orm import _fixtures
-class UnitOfWorkTest(object):
+class UnitOfWorkTest:
pass
@@ -627,7 +627,7 @@ class ClauseAttributesTest(fixtures.MappedTest):
eq_(hb.value, False)
def test_clauseelement_accessor(self):
- class Thing(object):
+ class Thing:
def __init__(self, value):
self.value = value
@@ -2191,7 +2191,7 @@ class SaveTest(_fixtures.FixtureTest):
names = []
- class Events(object):
+ class Events:
def before_insert(self, mapper, connection, instance):
self.current_instance = instance
names.append(instance.name)
@@ -3496,7 +3496,7 @@ class PartialNullPKTest(fixtures.MappedTest):
class EnsurePKSortableTest(fixtures.MappedTest):
- class SomeEnum(object):
+ class SomeEnum:
# Implements PEP 435 in the minimal fashion needed by SQLAlchemy
__members__ = OrderedDict()
diff --git a/test/orm/test_unitofworkv2.py b/test/orm/test_unitofworkv2.py
index fac4897bb..efd581db2 100644
--- a/test/orm/test_unitofworkv2.py
+++ b/test/orm/test_unitofworkv2.py
@@ -41,7 +41,7 @@ from sqlalchemy.testing.schema import Table
from test.orm import _fixtures
-class AssertsUOW(object):
+class AssertsUOW:
def _get_test_uow(self, session):
uow = unitofwork.UOWTransaction(session)
deleted = set(session._deleted)
@@ -2833,11 +2833,11 @@ class TypeWoBoolTest(fixtures.MappedTest, testing.AssertsExecutionResults):
def define_tables(cls, metadata):
from sqlalchemy import TypeDecorator
- class NoBool(object):
+ class NoBool:
def __nonzero__(self):
raise NotImplementedError("not supported")
- class MyWidget(object):
+ class MyWidget:
def __init__(self, text):
self.text = text
diff --git a/test/orm/test_update_delete.py b/test/orm/test_update_delete.py
index 21863c57a..b2743024a 100644
--- a/test/orm/test_update_delete.py
+++ b/test/orm/test_update_delete.py
@@ -195,7 +195,7 @@ class UpdateDeleteTest(fixtures.MappedTest):
def test_evaluate_clauseelement(self):
User = self.classes.User
- class Thing(object):
+ class Thing:
def __clause_element__(self):
return User.name.__clause_element__()
@@ -209,7 +209,7 @@ class UpdateDeleteTest(fixtures.MappedTest):
def test_evaluate_invalid(self):
User = self.classes.User
- class Thing(object):
+ class Thing:
def __clause_element__(self):
return 5
@@ -236,7 +236,7 @@ class UpdateDeleteTest(fixtures.MappedTest):
eq_(jill.name, "moonbeam")
def test_evaluate_synonym_string(self):
- class Foo(object):
+ class Foo:
pass
self.mapper_registry.map_imperatively(
@@ -251,7 +251,7 @@ class UpdateDeleteTest(fixtures.MappedTest):
eq_(jill.uname, "moonbeam")
def test_evaluate_synonym_attr(self):
- class Foo(object):
+ class Foo:
pass
self.mapper_registry.map_imperatively(
@@ -266,7 +266,7 @@ class UpdateDeleteTest(fixtures.MappedTest):
eq_(jill.uname, "moonbeam")
def test_evaluate_double_synonym_attr(self):
- class Foo(object):
+ class Foo:
pass
self.mapper_registry.map_imperatively(
diff --git a/test/orm/test_utils.py b/test/orm/test_utils.py
index ba16d7e9a..748ef152d 100644
--- a/test/orm/test_utils.py
+++ b/test/orm/test_utils.py
@@ -46,7 +46,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
return table
def test_simple(self):
- class Point(object):
+ class Point:
pass
table = self._fixture(Point)
@@ -61,7 +61,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
assert alias.id.__clause_element__().table is not table
def test_named_entity(self):
- class Point(object):
+ class Point:
pass
self._fixture(Point)
@@ -73,7 +73,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
)
def test_named_selectable(self):
- class Point(object):
+ class Point:
pass
table = self._fixture(Point)
@@ -85,7 +85,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
)
def test_not_instantiatable(self):
- class Point(object):
+ class Point:
pass
self._fixture(Point)
@@ -94,7 +94,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
assert_raises(TypeError, alias)
def test_instancemethod(self):
- class Point(object):
+ class Point:
def zero(self):
self.x, self.y = 0, 0
@@ -106,7 +106,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
assert getattr(alias, "zero")
def test_classmethod(self):
- class Point(object):
+ class Point:
@classmethod
def max_x(cls):
return 100
@@ -119,7 +119,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
assert Point.max_x() == alias.max_x() == 100
def test_simple_property(self):
- class Point(object):
+ class Point:
@property
def max_x(self):
return 100
@@ -133,7 +133,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
assert Point.max_x is alias.max_x
def test_descriptors(self):
- class descriptor(object):
+ class descriptor:
def __init__(self, fn):
self.fn = fn
@@ -146,7 +146,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
def method(self):
return "method"
- class Point(object):
+ class Point:
center = (0, 0)
@descriptor
@@ -171,7 +171,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
assert child.table is table
def test_hybrid_descriptor_one(self):
- class Point(object):
+ class Point:
def __init__(self, x, y):
self.x, self.y = x, y
@@ -191,7 +191,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
)
def test_hybrid_descriptor_two(self):
- class Point(object):
+ class Point:
def __init__(self, x, y):
self.x, self.y = x, y
@@ -217,7 +217,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
)
def test_hybrid_descriptor_three(self):
- class Point(object):
+ class Point:
def __init__(self, x, y):
self.x, self.y = x, y
@@ -289,7 +289,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
)
def test_proxy_descriptor_one(self):
- class Point(object):
+ class Point:
def __init__(self, x, y):
self.x, self.y = x, y
@@ -407,7 +407,7 @@ class AliasedClassTest(fixtures.MappedTest, AssertsCompiledSQL):
)
def test_parententity_vs_parentmapper(self):
- class Point(object):
+ class Point:
pass
self._fixture(Point, properties={"x_syn": synonym("x")})
diff --git a/test/orm/test_validators.py b/test/orm/test_validators.py
index 1c491e75f..817d0fbc5 100644
--- a/test/orm/test_validators.py
+++ b/test/orm/test_validators.py
@@ -256,7 +256,7 @@ class ValidatorTest(_fixtures.FixtureTest):
users = self.tables.users
canary = Mock()
- class SomeValidator(object):
+ class SomeValidator:
def __call__(self, obj, key, name):
canary(key, name)
ne_(name, "fred")
@@ -272,7 +272,7 @@ class ValidatorTest(_fixtures.FixtureTest):
def test_validator_multi_warning(self):
users = self.tables.users
- class Foo(object):
+ class Foo:
@validates("name")
def validate_one(self, key, value):
pass
@@ -290,7 +290,7 @@ class ValidatorTest(_fixtures.FixtureTest):
users,
)
- class Bar(object):
+ class Bar:
@validates("id")
def validate_three(self, key, value):
return value + 10
diff --git a/test/sql/test_compare.py b/test/sql/test_compare.py
index 5258d09b0..814d9a2ad 100644
--- a/test/sql/test_compare.py
+++ b/test/sql/test_compare.py
@@ -166,7 +166,7 @@ class MyType3(TypeDecorator):
self.arg = arg
-class CoreFixtures(object):
+class CoreFixtures:
# lambdas which return a tuple of ColumnElement objects.
# must return at least two objects that should compare differently.
# to test more varieties of "difference" additional objects can be added.
@@ -1049,7 +1049,7 @@ class CoreFixtures(object):
]
-class CacheKeyFixture(object):
+class CacheKeyFixture:
def _compare_equal(self, a, b, compare_values):
a_key = a._generate_cache_key()
b_key = b._generate_cache_key()
diff --git a/test/sql/test_defaults.py b/test/sql/test_defaults.py
index 2011744fb..f3260f272 100644
--- a/test/sql/test_defaults.py
+++ b/test/sql/test_defaults.py
@@ -140,11 +140,11 @@ class DefaultObjectTest(fixtures.TestBase):
def fn2(x, y, z=3):
pass
- class fn3(object):
+ class fn3:
def __init__(self, x, y):
pass
- class FN4(object):
+ class FN4:
def __call__(self, x, y):
pass
@@ -170,21 +170,21 @@ class DefaultObjectTest(fixtures.TestBase):
fn5 = list
- class fn6a(object):
+ class fn6a:
def __init__(self, x):
eq_(x, "context")
- class fn6b(object):
+ class fn6b:
def __init__(self, x, y=3):
eq_(x, "context")
- class FN7(object):
+ class FN7:
def __call__(self, x):
eq_(x, "context")
fn7 = FN7()
- class FN8(object):
+ class FN8:
def __call__(self, x, y=3):
eq_(x, "context")
@@ -396,7 +396,7 @@ class DefaultRoundTripTest(fixtures.TablesTest):
use_function_defaults = testing.against("postgresql", "mssql")
is_oracle = testing.against("oracle")
- class MyClass(object):
+ class MyClass:
@classmethod
def gen_default(cls, ctx):
return "hi"
diff --git a/test/sql/test_delete.py b/test/sql/test_delete.py
index 6f7b3f8f5..45ead811f 100644
--- a/test/sql/test_delete.py
+++ b/test/sql/test_delete.py
@@ -21,7 +21,7 @@ from sqlalchemy.testing.schema import Column
from sqlalchemy.testing.schema import Table
-class _DeleteTestBase(object):
+class _DeleteTestBase:
@classmethod
def define_tables(cls, metadata):
Table(
diff --git a/test/sql/test_deprecations.py b/test/sql/test_deprecations.py
index 46c526c4b..89938ee5e 100644
--- a/test/sql/test_deprecations.py
+++ b/test/sql/test_deprecations.py
@@ -1811,7 +1811,7 @@ class FutureSelectTest(fixtures.TestBase, AssertsCompiledSQL):
def test_new_calling_style_thing_ok_actually_use_iter(self, table_fixture):
table1, table2 = table_fixture
- class Thing(object):
+ class Thing:
def __iter__(self):
return iter([table1.c.name, table1.c.description])
diff --git a/test/sql/test_insert.py b/test/sql/test_insert.py
index 51045daac..74a60bd21 100644
--- a/test/sql/test_insert.py
+++ b/test/sql/test_insert.py
@@ -28,7 +28,7 @@ from sqlalchemy.testing import expect_warnings
from sqlalchemy.testing import fixtures
-class ORMExpr(object):
+class ORMExpr:
def __init__(self, col):
self.col = col
@@ -36,7 +36,7 @@ class ORMExpr(object):
return self.col
-class _InsertTestBase(object):
+class _InsertTestBase:
@classmethod
def define_tables(cls, metadata):
Table(
diff --git a/test/sql/test_lambdas.py b/test/sql/test_lambdas.py
index a2aa9705c..fd6b1eb41 100644
--- a/test/sql/test_lambdas.py
+++ b/test/sql/test_lambdas.py
@@ -689,7 +689,7 @@ class LambdaElementTest(
# refer to unknown types of objects inside the lambda. these have
# to be resolved outside of the lambda because we otherwise can't
# be sure they can be safely used as cache keys.
- class Thing(object):
+ class Thing:
def __init__(self, col_expr):
self.col_expr = col_expr
@@ -713,7 +713,7 @@ class LambdaElementTest(
# refer to unknown types of objects inside the lambda. these have
# to be resolved outside of the lambda because we otherwise can't
# be sure they can be safely used as cache keys.
- class Thing(object):
+ class Thing:
def __init__(self, col_expr):
self.col_expr = col_expr
@@ -765,7 +765,7 @@ class LambdaElementTest(
# test the above 'test_reject_plain_object' with the expected
# workaround
- class Thing(object):
+ class Thing:
def __init__(self, col_expr):
self.col_expr = col_expr
@@ -1662,7 +1662,7 @@ class LambdaElementTest(
def test_cache_key_instance_variable_issue_incorrect(self):
t1 = table("t1", column("q"), column("p"))
- class Foo(object):
+ class Foo:
def __init__(self, value):
self.value = value
@@ -1681,7 +1681,7 @@ class LambdaElementTest(
def test_cache_key_instance_variable_issue_correct_one(self):
t1 = table("t1", column("q"), column("p"))
- class Foo(object):
+ class Foo:
def __init__(self, value):
self.value = value
@@ -1701,7 +1701,7 @@ class LambdaElementTest(
def test_cache_key_instance_variable_issue_correct_two(self):
t1 = table("t1", column("q"), column("p"))
- class Foo(object):
+ class Foo:
def __init__(self, value):
self.value = value
diff --git a/test/sql/test_metadata.py b/test/sql/test_metadata.py
index bd9213647..e87063a90 100644
--- a/test/sql/test_metadata.py
+++ b/test/sql/test_metadata.py
@@ -354,7 +354,7 @@ class MetaDataTest(fixtures.TestBase, ComparesTables):
)
def test_fk_given_non_col_clauseelem(self):
- class Foo(object):
+ class Foo:
def __clause_element__(self):
return bindparam("x")
@@ -379,7 +379,7 @@ class MetaDataTest(fixtures.TestBase, ComparesTables):
def test_fk_given_col_non_table_clauseelem(self):
t = Table("t", MetaData(), Column("x", Integer))
- class Foo(object):
+ class Foo:
def __clause_element__(self):
return t.alias().c.x
@@ -2072,7 +2072,7 @@ class PKAutoIncrementTest(fixtures.TestBase):
class SchemaTypeTest(fixtures.TestBase):
__backend__ = True
- class TrackEvents(object):
+ class TrackEvents:
column = None
table = None
evt_targets = ()
@@ -2961,7 +2961,7 @@ class ConstraintTest(fixtures.TestBase):
def test_clauseelement_extraction_one(self):
t = Table("t", MetaData(), Column("x", Integer), Column("y", Integer))
- class MyThing(object):
+ class MyThing:
def __clause_element__(self):
return t.c.x + 5
@@ -2971,7 +2971,7 @@ class ConstraintTest(fixtures.TestBase):
def test_clauseelement_extraction_two(self):
t = Table("t", MetaData(), Column("x", Integer), Column("y", Integer))
- class MyThing(object):
+ class MyThing:
def __clause_element__(self):
return t.c.x + 5
@@ -2984,7 +2984,7 @@ class ConstraintTest(fixtures.TestBase):
expr1 = t.c.x + 5
- class MyThing(object):
+ class MyThing:
def __clause_element__(self):
return expr1
@@ -3332,7 +3332,7 @@ class ConstraintTest(fixtures.TestBase):
def test_column_accessor_clause_element(self):
c1 = Column("x", Integer)
- class CThing(object):
+ class CThing:
def __init__(self, c):
self.c = c
@@ -3743,7 +3743,7 @@ class ConstraintTest(fixtures.TestBase):
m = MetaData()
t2 = Table("t2", m, Column("x", Integer))
- class SomeClass(object):
+ class SomeClass:
def __clause_element__(self):
return t2
@@ -3758,7 +3758,7 @@ class ConstraintTest(fixtures.TestBase):
@testing.fixture
def no_pickle_annotated(self):
- class NoPickle(object):
+ class NoPickle:
def __reduce__(self):
raise NotImplementedError()
diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py
index 45ea30548..b86e8d075 100644
--- a/test/sql/test_operators.py
+++ b/test/sql/test_operators.py
@@ -449,7 +449,7 @@ class CustomUnaryOperatorTest(fixtures.TestBase, testing.AssertsCompiledSQL):
)
-class _CustomComparatorTests(object):
+class _CustomComparatorTests:
def test_override_builtin(self):
c1 = Column("foo", self._add_override_factory())
self._assert_add_override(c1)
@@ -2126,7 +2126,7 @@ class InTest(fixtures.TestBase, testing.AssertsCompiledSQL):
)
def test_in_arbitrary_sequence(self):
- class MySeq(object):
+ class MySeq:
def __init__(self, d):
self.d = d
diff --git a/test/sql/test_resultset.py b/test/sql/test_resultset.py
index cdc314e2f..9d4e14517 100644
--- a/test/sql/test_resultset.py
+++ b/test/sql/test_resultset.py
@@ -359,7 +359,7 @@ class CursorResultTest(fixtures.TablesTest):
result = connection.execute(select(1))
row = result.first()
- class unprintable(object):
+ class unprintable:
def __str__(self):
raise ValueError("nope")
@@ -1410,7 +1410,7 @@ class CursorResultTest(fixtures.TablesTest):
"""
- class MyList(object):
+ class MyList:
def __init__(self, data):
self.internal_list = data
@@ -2885,7 +2885,7 @@ class AlternateCursorResultTest(fixtures.TablesTest):
argnames="method_name",
)
def test_handle_error_in_fetch(self, strategy_cls, method_name):
- class cursor(object):
+ class cursor:
def raise_(self):
raise IOError("random non-DBAPI error during cursor operation")
diff --git a/test/sql/test_roles.py b/test/sql/test_roles.py
index ff4f10f1a..abbef8e28 100644
--- a/test/sql/test_roles.py
+++ b/test/sql/test_roles.py
@@ -41,7 +41,7 @@ m = MetaData()
t = Table("t", m, Column("q", Integer))
-class NotAThing1(object):
+class NotAThing1:
pass
@@ -55,7 +55,7 @@ class NotAThing2(ClauseElement):
not_a_thing2 = NotAThing2()
-class NotAThing3(object):
+class NotAThing3:
def __clause_element__(self):
return not_a_thing2
@@ -215,7 +215,7 @@ class RoleTest(fixtures.TestBase):
def some_function():
pass
- class Thing(object):
+ class Thing:
def __clause_element__(self):
return some_function
diff --git a/test/sql/test_select.py b/test/sql/test_select.py
index c9abb7fb8..f79d95a65 100644
--- a/test/sql/test_select.py
+++ b/test/sql/test_select.py
@@ -67,7 +67,7 @@ class FutureSelectTest(fixtures.TestBase, AssertsCompiledSQL):
)
def test_new_calling_style_clauseelement_thing_that_has_iter(self):
- class Thing(object):
+ class Thing:
def __clause_element__(self):
return table1
@@ -82,11 +82,11 @@ class FutureSelectTest(fixtures.TestBase, AssertsCompiledSQL):
)
def test_new_calling_style_inspectable_ce_thing_that_has_iter(self):
- class Thing(object):
+ class Thing:
def __iter__(self):
return iter(["a", "b", "c"])
- class InspectedThing(object):
+ class InspectedThing:
def __clause_element__(self):
return table1
diff --git a/test/sql/test_type_expressions.py b/test/sql/test_type_expressions.py
index e0e0858a4..cab4f6371 100644
--- a/test/sql/test_type_expressions.py
+++ b/test/sql/test_type_expressions.py
@@ -14,7 +14,7 @@ from sqlalchemy.testing import eq_
from sqlalchemy.testing import fixtures
-class _ExprFixture(object):
+class _ExprFixture:
def _test_table(self, type_):
test_table = Table(
"test_table", MetaData(), Column("x", String), Column("y", type_)
@@ -363,7 +363,7 @@ class DerivedTest(_ExprFixture, fixtures.TestBase, AssertsCompiledSQL):
)
-class RoundTripTestBase(object):
+class RoundTripTestBase:
def test_round_trip(self, connection):
connection.execute(
self.tables.test_table.insert(),
diff --git a/test/sql/test_types.py b/test/sql/test_types.py
index d57603622..0891defc2 100644
--- a/test/sql/test_types.py
+++ b/test/sql/test_types.py
@@ -473,7 +473,7 @@ class PickleTypesTest(fixtures.TestBase):
loads(dumps(meta))
-class _UserDefinedTypeFixture(object):
+class _UserDefinedTypeFixture:
@classmethod
def define_tables(cls, metadata):
class MyType(types.UserDefinedType):
@@ -1064,7 +1064,7 @@ class TypeCoerceCastTest(fixtures.TablesTest):
# test coerce from nulltype - e.g. use an object that
# doesn't match to a known type
- class MyObj(object):
+ class MyObj:
def __str__(self):
return "THISISMYOBJ"
@@ -1190,7 +1190,7 @@ class TypeCoerceCastTest(fixtures.TablesTest):
t = self.tables.t
conn.execute(t.insert().values(data=coerce_fn("d1", MyType)))
- class MyFoob(object):
+ class MyFoob:
def __clause_element__(self):
return t.c.data
@@ -2323,7 +2323,7 @@ class EnumTest(AssertsCompiledSQL, fixtures.TablesTest):
m1.create_all(testing.db)
def test_non_native_constraint_custom_type(self):
- class Foob(object):
+ class Foob:
def __init__(self, name):
self.name = name
@@ -3202,7 +3202,7 @@ class ExpressionTest(
class MyFoobarType(types.UserDefinedType):
pass
- class Foo(object):
+ class Foo:
pass
# unknown type + integer, right hand bind
@@ -3315,11 +3315,11 @@ class ExpressionTest(
def test_detect_coercion_of_builtins(self):
@inspection._self_inspects
- class SomeSQLAThing(object):
+ class SomeSQLAThing:
def __repr__(self):
return "some_sqla_thing()"
- class SomeOtherThing(object):
+ class SomeOtherThing:
pass
assert_raises_message(
@@ -3629,7 +3629,7 @@ class BooleanTest(
)
def test_non_native_constraint_custom_type(self):
- class Foob(object):
+ class Foob:
def __init__(self, value):
self.value = value
diff --git a/test/sql/test_update.py b/test/sql/test_update.py
index 93deae556..f59f02a7b 100644
--- a/test/sql/test_update.py
+++ b/test/sql/test_update.py
@@ -31,7 +31,7 @@ from sqlalchemy.testing.schema import Column
from sqlalchemy.testing.schema import Table
-class _UpdateFromTestBase(object):
+class _UpdateFromTestBase:
@classmethod
def define_tables(cls, metadata):
Table(
@@ -128,7 +128,7 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
def test_update_custom_key_thing(self):
table1 = self.tables.mytable
- class Thing(object):
+ class Thing:
def __clause_element__(self):
return table1.c.name
@@ -147,7 +147,7 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
def test_update_ordered_custom_key_thing(self):
table1 = self.tables.mytable
- class Thing(object):
+ class Thing:
def __clause_element__(self):
return table1.c.name
@@ -166,7 +166,7 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
def test_update_broken_custom_key_thing(self):
table1 = self.tables.mytable
- class Thing(object):
+ class Thing:
def __clause_element__(self):
return 5
@@ -180,7 +180,7 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
def test_update_ordered_broken_custom_key_thing(self):
table1 = self.tables.mytable
- class Thing(object):
+ class Thing:
def __clause_element__(self):
return 5
diff --git a/test/sql/test_values.py b/test/sql/test_values.py
index dcd32a679..f5ae9ea53 100644
--- a/test/sql/test_values.py
+++ b/test/sql/test_values.py
@@ -168,7 +168,7 @@ class ValuesTest(fixtures.TablesTest, AssertsCompiledSQL):
@testing.fixture
def tricky_types_parameter_fixture(self):
- class SomeEnum(object):
+ class SomeEnum:
# Implements PEP 435 in the minimal fashion needed by SQLAlchemy
__members__ = OrderedDict()