summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-07-30 12:18:33 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-07-30 12:18:33 -0400
commit0bf33068f43c75cdaac3bf25cf918847f07bf330 (patch)
treea820a78b5e45c754fdf1dbf8719fbb5d45c1bb57
parentd16f8130e962f465de739ebf8345040771af3ed6 (diff)
downloadsqlalchemy-0bf33068f43c75cdaac3bf25cf918847f07bf330.tar.gz
- ensure all tests are named test_*
-rw-r--r--test/engine/test_logging.py6
-rw-r--r--test/engine/test_pool.py9
-rw-r--r--test/engine/test_reflection.py2
-rw-r--r--test/ext/test_associationproxy.py2
-rw-r--r--test/orm/inheritance/test_abc_polymorphic.py6
-rw-r--r--test/orm/inheritance/test_assorted_poly.py34
-rw-r--r--test/orm/inheritance/test_manytomany.py10
-rw-r--r--test/orm/inheritance/test_poly_linked_list.py8
-rw-r--r--test/orm/inheritance/test_productspec.py10
-rw-r--r--test/orm/test_relationships.py6
-rw-r--r--test/sql/test_rowcount.py2
11 files changed, 48 insertions, 47 deletions
diff --git a/test/engine/test_logging.py b/test/engine/test_logging.py
index 94ea22813..ea2ad3964 100644
--- a/test/engine/test_logging.py
+++ b/test/engine/test_logging.py
@@ -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()
diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py
index 7b56e15f5..0ad26e890 100644
--- a/test/engine/test_pool.py
+++ b/test/engine/test_pool.py
@@ -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):
diff --git a/test/engine/test_reflection.py b/test/engine/test_reflection.py
index 1ddae6b40..03b2033d5 100644
--- a/test/engine/test_reflection.py
+++ b/test/engine/test_reflection.py
@@ -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)
diff --git a/test/ext/test_associationproxy.py b/test/ext/test_associationproxy.py
index 4b923e318..67e474705 100644
--- a/test/ext/test_associationproxy.py
+++ b/test/ext/test_associationproxy.py
@@ -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),
diff --git a/test/orm/inheritance/test_abc_polymorphic.py b/test/orm/inheritance/test_abc_polymorphic.py
index f32805cc7..e065c9f9d 100644
--- a/test/orm/inheritance/test_abc_polymorphic.py
+++ b/test/orm/inheritance/test_abc_polymorphic.py
@@ -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')
diff --git a/test/orm/inheritance/test_assorted_poly.py b/test/orm/inheritance/test_assorted_poly.py
index cbfbf5ba7..40669ee3b 100644
--- a/test/orm/inheritance/test_assorted_poly.py
+++ b/test/orm/inheritance/test_assorted_poly.py
@@ -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):
diff --git a/test/orm/inheritance/test_manytomany.py b/test/orm/inheritance/test_manytomany.py
index ace90c7fa..0554db7b1 100644
--- a/test/orm/inheritance/test_manytomany.py
+++ b/test/orm/inheritance/test_manytomany.py
@@ -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
diff --git a/test/orm/inheritance/test_poly_linked_list.py b/test/orm/inheritance/test_poly_linked_list.py
index ec263b3b0..f131feca7 100644
--- a/test/orm/inheritance/test_poly_linked_list.py
+++ b/test/orm/inheritance/test_poly_linked_list.py
@@ -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', []),
diff --git a/test/orm/inheritance/test_productspec.py b/test/orm/inheritance/test_productspec.py
index 3de5e3695..9918482ac 100644
--- a/test/orm/inheritance/test_productspec.py
+++ b/test/orm/inheritance/test_productspec.py
@@ -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,
diff --git a/test/orm/test_relationships.py b/test/orm/test_relationships.py
index 16abbb37b..6bcb02639 100644
--- a/test/orm/test_relationships.py
+++ b/test/orm/test_relationships.py
@@ -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,
diff --git a/test/sql/test_rowcount.py b/test/sql/test_rowcount.py
index 8913b955d..46e10e192 100644
--- a/test/sql/test_rowcount.py
+++ b/test/sql/test_rowcount.py
@@ -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()