diff options
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/db/dulwich/__init__.py | 4 | ||||
-rw-r--r-- | git/test/db/dulwich/test_base.py | 22 | ||||
-rw-r--r-- | git/test/db/lib.py | 3 | ||||
-rw-r--r-- | git/test/lib/helper.py | 6 |
4 files changed, 33 insertions, 2 deletions
diff --git a/git/test/db/dulwich/__init__.py b/git/test/db/dulwich/__init__.py new file mode 100644 index 00000000..8a681e42 --- /dev/null +++ b/git/test/db/dulwich/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors +# +# This module is part of GitDB and is released under +# the New BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/git/test/db/dulwich/test_base.py b/git/test/db/dulwich/test_base.py new file mode 100644 index 00000000..f3489014 --- /dev/null +++ b/git/test/db/dulwich/test_base.py @@ -0,0 +1,22 @@ +# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors +# +# This module is part of GitDB and is released under +# the New BSD License: http://www.opensource.org/licenses/bsd-license.php +from git.test.db.base import RepoBase +from git.db.complex import PureCompatibilityGitDB + +try: + import git.db.dulwich # import test + + class TestPyDBBase(RepoBase): + + RepoCls = PureCompatibilityGitDB + + # def test_basics(self): + # pass + +except ImportError: + del(RepoBase) + import warnings + warnings.warn("Skipped all dulwich tests as they are not in the path") +#END handle import diff --git a/git/test/db/lib.py b/git/test/db/lib.py index 499ca252..2b3ddde5 100644 --- a/git/test/db/lib.py +++ b/git/test/db/lib.py @@ -70,7 +70,8 @@ class TestDBBase(TestBase): each test type has its own repository """ if cls.needs_ro_repo: - assert cls.RepoCls is not None, "RepoCls class member must be set" + if cls is not TestDBBase: + assert cls.RepoCls is not None, "RepoCls class member must be set in %s" % cls cls.rorepo = cls.RepoCls(rorepo_dir()) #END handle rorepo diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index d9a92a52..ef2d3280 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -207,7 +207,11 @@ class GlobalsItemDeletorMetaCls(type): new_type = super(GlobalsItemDeletorMetaCls, metacls).__new__(metacls, name, bases, clsdict) if name != metacls.ModuleToDelete: mod = __import__(new_type.__module__, globals(), locals(), new_type.__module__) - delattr(mod, metacls.ModuleToDelete) + try: + delattr(mod, metacls.ModuleToDelete) + except AttributeError: + pass + #END skip case that people import our base without actually using it #END handle deletion return new_type |