]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Repair tests for older SQLite, timing, pypy
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Feb 2021 21:47:53 +0000 (16:47 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Feb 2021 21:47:53 +0000 (16:47 -0500)
Change-Id: I9e425d2415d18a893342244755c7748b546fb20d

doc/build/tutorial/data.rst
test/dialect/test_sqlite.py
test/orm/test_deprecations.py

index 1b9d946b291c33df72761442761a17fe75d51416..5da8b8667b6bfaec1e8a893bc99b4cb0b1f517e3 100644 (file)
@@ -1520,7 +1520,7 @@ number the email addresses of individual users:
     ...     user_table.c.name,
     ...     address_table.c.email_address
     ... ).select_from(user_table).join(address_table)
-    >>> with engine.connect() as conn:
+    >>> with engine.connect() as conn:  # doctest:+SKIP
     ...     result = conn.execute(stmt)
     ...     print(result.all())
     {opensql}BEGIN (implicit)
@@ -1541,7 +1541,7 @@ We also may make use of the ``ORDER BY`` clause using :paramref:`_functions.Func
     ...     func.count().over(order_by=user_table.c.name),
     ...     user_table.c.name,
     ...     address_table.c.email_address).select_from(user_table).join(address_table)
-    >>> with engine.connect() as conn:
+    >>> with engine.connect() as conn:  # doctest:+SKIP
     ...     result = conn.execute(stmt)
     ...     print(result.all())
     {opensql}BEGIN (implicit)
@@ -1592,7 +1592,7 @@ using the :meth:`_functions.FunctionElement.filter` method::
     ...     func.count(address_table.c.email_address).filter(user_table.c.name == 'sandy'),
     ...     func.count(address_table.c.email_address).filter(user_table.c.name == 'spongebob')
     ... ).select_from(user_table).join(address_table)
-    >>> with engine.connect() as conn:
+    >>> with engine.connect() as conn:  # doctest:+SKIP
     ...     result = conn.execute(stmt)
     ...     print(result.all())
     {opensql}BEGIN (implicit)
@@ -1637,7 +1637,7 @@ modern versions of SQLite::
 
     >>> onetwothree = func.json_each('["one", "two", "three"]').table_valued("value")
     >>> stmt = select(onetwothree).where(onetwothree.c.value.in_(["two", "three"]))
-    >>> with engine.connect() as conn:
+    >>> with engine.connect() as conn:  # doctest:+SKIP
     ...     result = conn.execute(stmt)
     ...     print(result.all())
     {opensql}BEGIN (implicit)
index 23ceb88b3cf61c2eea3cbb1d29fb85d8dd3b26fd..ad169eebf9bf5c7717f6b0752c2baf5643cad8d6 100644 (file)
@@ -536,17 +536,15 @@ class DefaultsTest(fixtures.TestBase, AssertsCompiledSQL):
             "t",
             self.metadata,
             Column("id", Integer, primary_key=True),
-            Column("x", DateTime(), server_default=func.now()),
+            Column("x", String(), server_default=func.lower("UPPERCASE")),
         )
         t.create(testing.db)
         with testing.db.begin() as conn:
-            now = conn.scalar(func.now())
-            today = datetime.datetime.today()
             conn.execute(t.insert())
-            conn.execute(t.insert().values(x=today))
+            conn.execute(t.insert().values(x="foobar"))
             eq_(
                 conn.execute(select(t.c.x).order_by(t.c.id)).fetchall(),
-                [(now,), (today,)],
+                [("uppercase",), ("foobar",)],
             )
 
     @testing.provide_metadata
index e15bb4674de6fbd9e641d76d159a6cbc8c97a986..34e3a483123a7ca672c823763665f6b8155018e7 100644 (file)
@@ -3017,7 +3017,7 @@ class NonPrimaryMapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
         with testing.expect_deprecated(
             "The mapper.non_primary parameter is deprecated"
         ):
-            mapper(
+            m = mapper(  # noqa F841
                 User,
                 users,
                 non_primary=True,