1
0
Fork 0

refactor: Move pytest fixtures to its own file

This commit is contained in:
Cristian 2020-07-07 08:36:58 -05:00
parent 1866da3f8a
commit d5fc13b34e
4 changed files with 11 additions and 8 deletions

0
tests/__init__.py Normal file
View file

10
tests/fixtures.py Normal file
View file

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

0
tests/test_args.py Normal file
View file

View file

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