Browse Source

move cmd fixture to archiver test module

Thomas Waldmann 9 years ago
parent
commit
1a248116db
2 changed files with 14 additions and 14 deletions
  1. 13 0
      borg/testsuite/archiver.py
  2. 1 14
      borg/testsuite/benchmark.py

+ 13 - 0
borg/testsuite/archiver.py

@@ -71,6 +71,19 @@ class environment_variable:
                 os.environ[k] = v
 
 
+@pytest.fixture(params=['python', 'binary'])
+def cmd(request):
+    if request.param == 'python':
+        exe = None
+    elif request.param == 'binary':
+        exe = 'borg.exe'
+    else:
+        raise ValueError("param must be 'python' or 'binary'")
+    def exec_fn(*args, **kw):
+        return exec_cmd(*args, exe=exe, fork=True, **kw)
+    return exec_fn
+
+
 def exec_cmd(*args, archiver=None, fork=False, exe=None, **kw):
     if fork:
         try:

+ 1 - 14
borg/testsuite/benchmark.py

@@ -10,20 +10,7 @@ import os
 
 import pytest
 
-from .archiver import changedir, exec_cmd
-
-
-@pytest.fixture(params=['python', 'binary'])
-def cmd(request):
-    if request.param == 'python':
-        exe = None
-    elif request.param == 'binary':
-        exe = 'borg.exe'
-    else:
-        raise ValueError("param must be 'python' or 'binary'")
-    def exec_fn(*args, **kw):
-        return exec_cmd(*args, exe=exe, fork=True, **kw)
-    return exec_fn
+from .archiver import changedir, cmd
 
 
 @pytest.yield_fixture