Browse Source

tests: Run compat tests from "normal" testsuite, but skip if C git was not
found.

Jelmer Vernooij 14 years ago
parent
commit
7c59b4bdb6
3 changed files with 7 additions and 4 deletions
  1. 0 4
      Makefile
  2. 2 0
      dulwich/tests/__init__.py
  3. 5 0
      dulwich/tests/compat/utils.py

+ 0 - 4
Makefile

@@ -20,14 +20,10 @@ install::
 
 check:: build
 	PYTHONPATH=.:$(PYTHONPATH) $(PYTHON) $(TESTRUNNER) dulwich
-	which git > /dev/null && PYTHONPATH=.:$(PYTHONPATH) $(PYTHON) $(TESTRUNNER) $(TESTFLAGS) -i compat
 
 check-noextensions:: clean
 	PYTHONPATH=.:$(PYTHONPATH) $(PYTHON) $(TESTRUNNER) $(TESTFLAGS) dulwich
 
-check-compat:: build
-	PYTHONPATH=.:$(PYTHONPATH) $(PYTHON) $(TESTRUNNER) $(TESTFLAGS) -i compat
-
 clean::
 	$(SETUP) clean --all
 	rm -f dulwich/*.so

+ 2 - 0
dulwich/tests/__init__.py

@@ -93,4 +93,6 @@ def test_suite():
     suite = doctest.DocFileSuite(setUp=setup, tearDown=teardown,
         *tutorial_files)
     result.addTests(suite)
+    from dulwich.tests.compat import test_suite as compat_test_suite
+    result.addTests(compat_test_suite())
     return result

+ 5 - 0
dulwich/tests/compat/utils.py

@@ -80,6 +80,10 @@ def require_git_version(required_version, git_path=_DEFAULT_GIT):
     :raise TestSkipped: if no suitable git version was found at the given path.
     """
     found_version = git_version(git_path=git_path)
+    if found_version is None:
+        raise TestSkipped('Test requires git >= %s, but c git not found' %
+                         (required_version, ))
+
     if len(required_version) > _VERSION_LEN:
         raise ValueError('Invalid version tuple %s, expected %i parts' %
                          (required_version, _VERSION_LEN))
@@ -153,6 +157,7 @@ def import_repo_to_dir(name):
     export_file.close()
     return temp_repo_dir
 
+
 def import_repo(name):
     """Import a repo from a fast-export file in a temporary directory.