]> 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:48:31 +0000 (15:48 -0500)
commitd41f28a192a176bb939dfffeea28e1a035062dee
tree21d6218d309bf1c1cc2295c871cb524877028f63
parent64952ac28b1911410f2b7c08a16492716689126d
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
(cherry picked from commit 12ec0e06858d84097a051a50a60fe9a1582ee95c)
lib/sqlalchemy/testing/exclusions.py
lib/sqlalchemy/testing/plugin/pytestplugin.py
test/orm/test_defaults.py