summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r--lib/sqlalchemy/testing/fixtures.py7
-rw-r--r--lib/sqlalchemy/testing/suite/test_rowcount.py11
-rw-r--r--lib/sqlalchemy/testing/warnings.py5
3 files changed, 13 insertions, 10 deletions
diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py
index 209ea415e..ac4d3d8fa 100644
--- a/lib/sqlalchemy/testing/fixtures.py
+++ b/lib/sqlalchemy/testing/fixtures.py
@@ -176,7 +176,6 @@ class TablesTest(TestBase):
cls.bind = cls.setup_bind()
cls._tables_metadata = sa.MetaData()
- cls._tables_metadata.bind = cls.bind
@classmethod
def _setup_once_inserts(cls):
@@ -354,6 +353,12 @@ def create_session(**kw):
return sa.orm.Session(config.db, **kw)
+def fixture_session(**kw):
+ kw.setdefault("autoflush", True)
+ kw.setdefault("expire_on_commit", True)
+ return sa.orm.Session(config.db, **kw)
+
+
class ORMTest(_ORMTest, TestBase):
pass
diff --git a/lib/sqlalchemy/testing/suite/test_rowcount.py b/lib/sqlalchemy/testing/suite/test_rowcount.py
index f3f902abd..bb344237a 100644
--- a/lib/sqlalchemy/testing/suite/test_rowcount.py
+++ b/lib/sqlalchemy/testing/suite/test_rowcount.py
@@ -1,6 +1,7 @@
from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import Integer
+from sqlalchemy import select
from sqlalchemy import Sequence
from sqlalchemy import String
from sqlalchemy import Table
@@ -51,12 +52,14 @@ class RowCountTest(fixtures.TablesTest):
[{"name": n, "department": d} for n, d in data],
)
- def test_basic(self):
+ def test_basic(self, connection):
employees_table = self.tables.employees
- s = employees_table.select()
- r = s.execute().fetchall()
+ s = select(
+ employees_table.c.name, employees_table.c.department
+ ).order_by(employees_table.c.employee_id)
+ rows = connection.execute(s).fetchall()
- assert len(r) == len(self.data)
+ eq_(rows, self.data)
def test_update_rowcount1(self, connection):
employees_table = self.tables.employees
diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py
index c948ba66f..1b078a263 100644
--- a/lib/sqlalchemy/testing/warnings.py
+++ b/lib/sqlalchemy/testing/warnings.py
@@ -62,11 +62,6 @@ def setup_filters():
r"The Connection.connect\(\) method is considered legacy",
# r".*DefaultGenerator.execute\(\)",
#
- # bound metadaa
- #
- r"The ``bind`` argument for schema methods that invoke SQL ",
- r"The Function.bind argument",
- r"The select.bind argument",
#
# result sets
#