summaryrefslogtreecommitdiff
path: root/git/test/db/pygit2/lib.py
blob: fab762e766a037bdb2d1d42299a59da50292aa2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""pygit2 specific utilities, as well as all the default ones"""

from git.test.lib import (
                            InheritedTestMethodsOverrideWrapperMetaClsAutoMixin,
                            needs_module_or_skip
                        )

__all__ = ['needs_pygit2_or_skip', 'Pygit2RequiredMetaMixin']

#{ Decoorators

def needs_pygit2_or_skip(func):
    """Skip this test if we have no pygit2 - print warning"""
    return needs_module_or_skip('pygit2')(func)

#}END decorators

#{ MetaClasses

class Pygit2RequiredMetaMixin(InheritedTestMethodsOverrideWrapperMetaClsAutoMixin):
    decorator = [needs_pygit2_or_skip]

#} END metaclasses