]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- ensure all tests are named test_*
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 30 Jul 2014 16:18:33 +0000 (12:18 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 30 Jul 2014 16:18:33 +0000 (12:18 -0400)
test/engine/test_logging.py
test/engine/test_pool.py
test/engine/test_reflection.py
test/ext/test_associationproxy.py
test/orm/inheritance/test_abc_polymorphic.py
test/orm/inheritance/test_assorted_poly.py
test/orm/inheritance/test_manytomany.py
test/orm/inheritance/test_poly_linked_list.py
test/orm/inheritance/test_productspec.py
test/orm/test_relationships.py
test/sql/test_rowcount.py

index 94ea22813e5dc9f8589c80bf5f0c4991b05a606c..ea2ad3964bc9b54c5ebe20825ef5de03bcad5fbc 100644 (file)
@@ -196,7 +196,7 @@ class EchoTest(fixtures.TestBase):
         logging.getLogger('sqlalchemy.engine').removeHandler(self.buf)
         logging.getLogger('sqlalchemy.engine').setLevel(self.level)
 
-    def testing_engine(self):
+    def _testing_engine(self):
         e = engines.testing_engine()
 
         # do an initial execute to clear out 'first connect'
@@ -235,8 +235,8 @@ class EchoTest(fixtures.TestBase):
     def test_echo_flag_independence(self):
         """test the echo flag's independence to a specific engine."""
 
-        e1 = self.testing_engine()
-        e2 = self.testing_engine()
+        e1 = self._testing_engine()
+        e2 = self._testing_engine()
 
         e1.echo = True
         e1.execute(select([1])).close()
index 7b56e15f549b67595658b671de6a5a8ecffb5521..0ad26e8909d54559cf62be673cfca44bc458f94f 100644 (file)
@@ -129,10 +129,10 @@ class PoolTest(PoolTestBase):
             p.dispose()
             p.recreate()
 
-    def testthreadlocal_del(self):
+    def test_threadlocal_del(self):
         self._do_testthreadlocal(useclose=False)
 
-    def testthreadlocal_close(self):
+    def test_threadlocal_close(self):
         self._do_testthreadlocal(useclose=True)
 
     def _do_testthreadlocal(self, useclose=False):
@@ -794,12 +794,13 @@ class DeprecatedPoolListenerTest(PoolTestBase):
             c.close()
             assert counts == [1, 2, 2]
 
+
 class QueuePoolTest(PoolTestBase):
 
-    def testqueuepool_del(self):
+    def test_queuepool_del(self):
         self._do_testqueuepool(useclose=False)
 
-    def testqueuepool_close(self):
+    def test_queuepool_close(self):
         self._do_testqueuepool(useclose=True)
 
     def _do_testqueuepool(self, useclose=False):
index 1ddae6b40a04decb87fd468780b27b05e97ff5f7..03b2033d54927e8d992445f090cccd3c72abf11b 100644 (file)
@@ -1065,7 +1065,7 @@ class CreateDropTest(fixtures.TestBase):
         eq_(oi, ['orders', 'items'])
 
 
-    def testcheckfirst(self):
+    def test_checkfirst(self):
         try:
             assert not users.exists(testing.db)
             users.create(bind=testing.db)
index 4b923e318cdb1e708b684563438b884e39f7543e..67e4747053e62e45daa2963c785a664f3e7cb15a 100644 (file)
@@ -802,7 +802,7 @@ class ScalarTest(fixtures.TestBase):
         assert a1.a2b_name is None
         assert a1.b_single is None
 
-    def custom_getset_test(self):
+    def test_custom_getset(self):
         metadata = MetaData()
         p = Table('p', metadata,
                               Column('id', Integer, primary_key=True),
index f32805cc7537c4269c63d7d13be59b9d1c58a50e..e065c9f9d42cfef3e2a49b036fbd0109b5bd5ee3 100644 (file)
@@ -24,7 +24,7 @@ class ABCTest(fixtures.MappedTest):
             Column('id', Integer, ForeignKey('b.id'), primary_key=True),
             Column('cdata', String(30)))
 
-    def make_test(fetchtype):
+    def _make_test(fetchtype):
         def test_roundtrip(self):
             class A(fixtures.ComparableEntity):pass
             class B(A):pass
@@ -86,7 +86,7 @@ class ABCTest(fixtures.MappedTest):
             test_roundtrip, 'test_%s' % fetchtype)
         return test_roundtrip
 
-    test_union = make_test('union')
-    test_none = make_test('none')
+    test_union = _make_test('union')
+    test_none = _make_test('none')
 
 
index cbfbf5ba77746dee540aece8477d818631fa611e..40669ee3b9e8d2e89126e20f7f0dea50434bf421 100644 (file)
@@ -135,20 +135,20 @@ class RelationshipTest2(fixtures.MappedTest):
             Column('data', String(30))
             )
 
-    def testrelationshiponsubclass_j1_nodata(self):
-        self.do_test("join1", False)
-    def testrelationshiponsubclass_j2_nodata(self):
-        self.do_test("join2", False)
-    def testrelationshiponsubclass_j1_data(self):
-        self.do_test("join1", True)
-    def testrelationshiponsubclass_j2_data(self):
-        self.do_test("join2", True)
-    def testrelationshiponsubclass_j3_nodata(self):
-        self.do_test("join3", False)
-    def testrelationshiponsubclass_j3_data(self):
-        self.do_test("join3", True)
-
-    def do_test(self, jointype="join1", usedata=False):
+    def test_relationshiponsubclass_j1_nodata(self):
+        self._do_test("join1", False)
+    def test_relationshiponsubclass_j2_nodata(self):
+        self._do_test("join2", False)
+    def test_relationshiponsubclass_j1_data(self):
+        self._do_test("join1", True)
+    def test_relationshiponsubclass_j2_data(self):
+        self._do_test("join2", True)
+    def test_relationshiponsubclass_j3_nodata(self):
+        self._do_test("join3", False)
+    def test_relationshiponsubclass_j3_data(self):
+        self._do_test("join3", True)
+
+    def _do_test(self, jointype="join1", usedata=False):
         class Person(AttrSettable):
             pass
         class Manager(Person):
@@ -252,7 +252,7 @@ class RelationshipTest3(fixtures.MappedTest):
            )
 
 def _generate_test(jointype="join1", usedata=False):
-    def do_test(self):
+    def _do_test(self):
         class Person(AttrSettable):
             pass
         class Manager(Person):
@@ -342,7 +342,7 @@ def _generate_test(jointype="join1", usedata=False):
             assert m.data.data == 'ms data'
 
     do_test = function_named(
-        do_test, 'test_relationship_on_base_class_%s_%s' % (
+        _do_test, 'test_relationship_on_base_class_%s_%s' % (
         jointype, data and "nodata" or "data"))
     return do_test
 
@@ -835,7 +835,7 @@ class GenerativeTest(fixtures.TestBase, AssertsExecutionResults):
         for t in reversed(metadata.sorted_tables):
             t.delete().execute()
 
-    def testjointo(self):
+    def test_join_to(self):
         # class definitions
         class PersistentObject(object):
             def __init__(self, **kwargs):
index ace90c7fa212653b6caa8b15ab7bded2efdedf3a..0554db7b1c16313aeb54026fff8b8ec10e00e9f2 100644 (file)
@@ -39,7 +39,7 @@ class InheritTest(fixtures.MappedTest):
                    primary_key=True ),
             )
 
-    def testbasic(self):
+    def test_basic(self):
         class Principal(object):
             def __init__(self, **kwargs):
                 for key, value in kwargs.items():
@@ -86,7 +86,7 @@ class InheritTest2(fixtures.MappedTest):
             Column('foo_id', Integer, ForeignKey('foo.id')),
             Column('bar_id', Integer, ForeignKey('bar.bid')))
 
-    def testget(self):
+    def test_get(self):
         class Foo(object):
             def __init__(self, data=None):
                 self.data = data
@@ -106,7 +106,7 @@ class InheritTest2(fixtures.MappedTest):
         # (ticket 185)
         assert sess.query(Bar).get(b.id).id == b.id
 
-    def testbasic(self):
+    def test_basic(self):
         class Foo(object):
             def __init__(self, data=None):
                 self.data = data
@@ -172,7 +172,7 @@ class InheritTest3(fixtures.MappedTest):
             Column('blub_id', Integer, ForeignKey('blub.id')),
             Column('foo_id', Integer, ForeignKey('foo.id')))
 
-    def testbasic(self):
+    def test_basic(self):
         class Foo(object):
             def __init__(self, data=None):
                 self.data = data
@@ -201,7 +201,7 @@ class InheritTest3(fixtures.MappedTest):
         found = [repr(l[0])] + sorted([repr(o) for o in l[0].foos])
         eq_(found, compare)
 
-    def testadvanced(self):
+    def test_advanced(self):
         class Foo(object):
             def __init__(self, data=None):
                 self.data = data
index ec263b3b04b862a66580ca86a937d84bd0117dc3..f131feca7f052eea78796e0c6c707d90c6b35a5e 100644 (file)
@@ -115,16 +115,16 @@ class PolymorphicCircularTest(fixtures.MappedTest):
         configure_mappers()
         assert table1_mapper.primary_key == (table1.c.id,), table1_mapper.primary_key
 
-    def testone(self):
+    def test_one(self):
         self._testlist([Table1, Table2, Table1, Table2])
 
-    def testtwo(self):
+    def test_two(self):
         self._testlist([Table3])
 
-    def testthree(self):
+    def test_three(self):
         self._testlist([Table2, Table1, Table1B, Table3, Table3, Table1B, Table1B, Table2, Table1])
 
-    def testfour(self):
+    def test_four(self):
         self._testlist([
                 Table2('t2', [Data('data1'), Data('data2')]),
                 Table1('t1', []),
index 3de5e36951c3881daec4c8b7f1781af144d024b5..9918482acc2cbfbea6f6b5ef82ffdd13c8b91837 100644 (file)
@@ -79,7 +79,7 @@ class InheritTest(fixtures.MappedTest):
         class RasterDocument(Document):
             pass
 
-    def testone(self):
+    def test_one(self):
         product_mapper = mapper(Product, products_table,
             polymorphic_on=products_table.c.product_type,
             polymorphic_identity='product')
@@ -126,7 +126,7 @@ class InheritTest(fixtures.MappedTest):
         print(new)
         assert orig == new == '<Assembly a1> specification=[<SpecLine 1.0 <Product p1>>, <SpecLine 1.0 <Detail d1>>] documents=None'
 
-    def testtwo(self):
+    def test_two(self):
         product_mapper = mapper(Product, products_table,
             polymorphic_on=products_table.c.product_type,
             polymorphic_identity='product')
@@ -157,7 +157,7 @@ class InheritTest(fixtures.MappedTest):
         print(new)
         assert orig == new == '[<SpecLine 1.0 <Product p1>>, <SpecLine 1.0 <Detail d1>>]'
 
-    def testthree(self):
+    def test_three(self):
         product_mapper = mapper(Product, products_table,
             polymorphic_on=products_table.c.product_type,
             polymorphic_identity='product')
@@ -210,7 +210,7 @@ class InheritTest(fixtures.MappedTest):
         print(new)
         assert orig == new  == '<Assembly a1> specification=[<SpecLine 1.0 <Detail d1>>] documents=[<Document doc1>, <RasterDocument doc2>]'
 
-    def testfour(self):
+    def test_four(self):
         """this tests the RasterDocument being attached to the Assembly, but *not* the Document.  this means only
         a "sub-class" task, i.e. corresponding to an inheriting mapper but not the base mapper, is created. """
 
@@ -256,7 +256,7 @@ class InheritTest(fixtures.MappedTest):
         a1 = session.query(Product).filter_by(name='a1').one()
         assert len(session.query(Document).all()) == 0
 
-    def testfive(self):
+    def test_five(self):
         """tests the late compilation of mappers"""
 
         specification_mapper = mapper(SpecLine, specification_table,
index 16abbb37b1ade13f4b828b051327d86a8b0648f6..6bcb02639a72970f995baaea7b2d80d43ec39535 100644 (file)
@@ -212,7 +212,7 @@ class DependencyTwoParentTest(fixtures.MappedTest):
         session.add(b)
         session.flush()
 
-    def testDeleteRootTable(self):
+    def test_DeleteRootTable(self):
         A = self.classes.A
 
         session = create_session()
@@ -221,7 +221,7 @@ class DependencyTwoParentTest(fixtures.MappedTest):
         session.delete(a)
         session.flush()
 
-    def testDeleteMiddleTable(self):
+    def test_DeleteMiddleTable(self):
         C = self.classes.C
 
         session = create_session()
@@ -1742,7 +1742,7 @@ class TypedAssociationTable(fixtures.MappedTest):
               Column('t1c1', MySpecialType(30), ForeignKey('t1.col1')),
               Column('t2c1', MySpecialType(30), ForeignKey('t2.col1')))
 
-    def testm2m(self):
+    def test_m2m(self):
         """Many-to-many tables with special types for candidate keys."""
 
         t2, t3, t1 = (self.tables.t2,
index 8913b955d1a0d9ff4032b5e878e9888682ea3a62..46e10e19273fabb49a994f3e5dc25bf0faa9cfde 100644 (file)
@@ -45,7 +45,7 @@ class FoundRowsTest(fixtures.TestBase, AssertsExecutionResults):
     def teardown_class(cls):
         metadata.drop_all()
 
-    def testbasic(self):
+    def test_basic(self):
         s = employees_table.select()
         r = s.execute().fetchall()