]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Rework combination exclusions
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 Feb 2020 20:38:39 +0000 (15:38 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 Feb 2020 20:47:09 +0000 (15:47 -0500)
commit12ec0e06858d84097a051a50a60fe9a1582ee95c
tree3b634110dcdc004e7cd4b91b85dbc46396b04d32
parentee1d914888113ceb9928ece6e0a715c813bdfcfa
Rework combination exclusions

The technique arrived at for doing exclusions inside of combinations
relies upon comparing all the arguments in a particular combination
to some set of combinations that were gathered as having
"exclusions".   This logic is actually broken for the
case where the @testing.combinations has an "id", but if we fix
that, we still have the issue of all the arguments being
compared, which is complicated and also doesn't work for the
case of a py2/py3 incompatibility like a timezone that has
fractional minutes or seconds in it.   It's also not clear
if a @testing.combinations that uses lambdas will work either
(maybe it does though because lambdax == lambdax compares...).

anyway, this patch reworks it so that we hit this on the decorator
side instead, where we add our own decorator and go through
the extra effort to create a decorator that accepts an extra
argument of "exclusions" which we can then check in a way that
is local to the whole pytest @combinations thing in the first place.
The only difficulty is that pytest is very sneaky about looking
at the test function so we need to make sure __wrapped__ isn't
set when doing this.

Change-Id: Ic57aae15b378e0f4ed009e4e82ae7ba73fb6dfc5
lib/sqlalchemy/testing/exclusions.py
lib/sqlalchemy/testing/plugin/pytestplugin.py
test/orm/test_defaults.py