main commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-16 16:30:25 +09:00
parent 91c7e04474
commit 537e7b363f
1146 changed files with 45926 additions and 77196 deletions

View File

@@ -1,5 +1,5 @@
# testing/config.py
# Copyright (C) 2005-2025 the SQLAlchemy authors and contributors
# Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -122,9 +122,7 @@ def combinations(
passed, each argument combination is turned into a pytest.param() object,
mapping the elements of the argument tuple to produce an id based on a
character value in the same position within the string template using the
following scheme:
.. sourcecode:: text
following scheme::
i - the given argument is a string that is part of the id only, don't
pass it as an argument
@@ -148,7 +146,7 @@ def combinations(
(operator.ne, "ne"),
(operator.gt, "gt"),
(operator.lt, "lt"),
id_="na",
id_="na"
)
def test_operator(self, opfunc, name):
pass
@@ -179,7 +177,8 @@ class Variation:
if typing.TYPE_CHECKING:
def __getattr__(self, key: str) -> bool: ...
def __getattr__(self, key: str) -> bool:
...
@property
def name(self):
@@ -230,9 +229,14 @@ def variation(argname_or_fn, cases=None):
@testing.variation("querytyp", ["select", "subquery", "legacy_query"])
@testing.variation("lazy", ["select", "raise", "raise_on_sql"])
def test_thing(self, querytyp, lazy, decl_base):
def test_thing(
self,
querytyp,
lazy,
decl_base
):
class Thing(decl_base):
__tablename__ = "thing"
__tablename__ = 'thing'
# use name directly
rel = relationship("Rel", lazy=lazy.name)
@@ -247,6 +251,7 @@ def variation(argname_or_fn, cases=None):
else:
querytyp.fail()
The variable provided is a slots object of boolean variables, as well
as the name of the case itself under the attribute ".name"
@@ -264,11 +269,9 @@ def variation(argname_or_fn, cases=None):
else:
argname = argname_or_fn
cases_plus_limitations = [
(
entry
if (isinstance(entry, tuple) and len(entry) == 2)
else (entry, None)
)
entry
if (isinstance(entry, tuple) and len(entry) == 2)
else (entry, None)
for entry in cases
]
@@ -277,11 +280,9 @@ def variation(argname_or_fn, cases=None):
)
return combinations(
*[
(
(variation._name, variation, limitation)
if limitation is not None
else (variation._name, variation)
)
(variation._name, variation, limitation)
if limitation is not None
else (variation._name, variation)
for variation, (case, limitation) in zip(
variations, cases_plus_limitations
)