Browse Source

refactor: Move pytest fixtures to its own file

Cristian 5 years ago
parent
commit
d5fc13b34e
4 changed files with 11 additions and 8 deletions
  1. 0 0
      tests/__init__.py
  2. 10 0
      tests/fixtures.py
  3. 0 0
      tests/test_args.py
  4. 1 8
      tests/test_init.py

+ 0 - 0
tests/__init__.py


+ 10 - 0
tests/fixtures.py

@@ -0,0 +1,10 @@
+import os
+import subprocess
+
+import pytest
+
[email protected]
+def process(tmp_path):
+    os.chdir(tmp_path)
+    process = subprocess.run(['archivebox', 'init'], capture_output=True)
+    return process

+ 0 - 0
tests/test_args.py


+ 1 - 8
tests/test_init.py

@@ -6,14 +6,7 @@ import subprocess
 from pathlib import Path
 import json
 
-import pytest
-
[email protected]
-def process(tmp_path):
-    os.chdir(tmp_path)
-    process = subprocess.run(['archivebox', 'init'], capture_output=True)
-    return process
-
+from .fixtures import *
 
 def test_init(tmp_path, process):
     assert "Initializing a new ArchiveBox collection in this folder..." in process.stdout.decode("utf-8")