diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-07-07 12:55:03 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-07-07 12:55:03 +0200 |
commit | 80aa40537a3596f24593b5a67adb6d635fe4fa22 (patch) | |
tree | 5e748c6ff6cba897ce6f3081f0a7634ebb756922 /git/test/db/dulwich/lib.py | |
parent | 690828ce2e03ce32c5a66186c543d7c5050287e4 (diff) | |
download | gitpython-80aa40537a3596f24593b5a67adb6d635fe4fa22.tar.gz |
Added auto-skip mixin metacls, some serious brainfuck, if the required module was not found. Its actually a nice mix between decorators which are class types, and a mixin as a metaclass, which applies said decorator. The InstanceDecorator wouldn't actually be needed, but it adds flexibility. Maybe it should be removed ...
Diffstat (limited to 'git/test/db/dulwich/lib.py')
-rw-r--r-- | git/test/db/dulwich/lib.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/git/test/db/dulwich/lib.py b/git/test/db/dulwich/lib.py new file mode 100644 index 00000000..a1110ffa --- /dev/null +++ b/git/test/db/dulwich/lib.py @@ -0,0 +1,18 @@ +"""dulwich specific utilities, as well as all the default ones""" + +from git.test.lib import * + +#{ Decoorators + +def needs_dulwich_or_skip(func): + """Skip this test if we have no dulwich - print warning""" + return needs_module_or_skip('dulwich')(func) + +#}END decorators + +#{ MetaClasses + +class DulwichRequiredMetaMixin(InheritedTestMethodsOverrideWrapperMetaClsAutoMixin): + decorator = [needs_dulwich_or_skip] + +#} END metaclasses |