Skip to content

Commit

Permalink
Move test/test_show.py fixture to conftest.py (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
dorothykiz1 authored Mar 10, 2022
1 parent 35718fb commit 8f5c6af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
14 changes: 14 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,17 @@ def benchmarks_fixture(tmpdir):
commit_hash = repo.get_hash_from_name(repo.get_branch_name())

return conf, repo, envs, commit_hash


@pytest.fixture
def show_fixture(tmpdir, example_results):
tmpdir = str(tmpdir)
os.chdir(tmpdir)

conf = config.Config.from_json(
{'results_dir': example_results,
'repo': tools.generate_test_repo(tmpdir).path,
'project': 'asv',
'environment_type': "shouldn't matter what"})

return conf
15 changes: 0 additions & 15 deletions test/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,13 @@
import textwrap
from os.path import abspath, dirname, join

import pytest

from asv import config

from . import tools

BENCHMARK_DIR = abspath(join(dirname(__file__), 'example_results'))
MACHINE_FILE = abspath(join(dirname(__file__), 'asv-machine.json'))

@pytest.fixture
def show_fixture(tmpdir, example_results):
tmpdir = str(tmpdir)
os.chdir(tmpdir)

conf = config.Config.from_json(
{'results_dir': example_results,
'repo': tools.generate_test_repo(tmpdir).path,
'project': 'asv',
'environment_type': "shouldn't matter what"})

return conf


def test_show(capsys, show_fixture):
conf = show_fixture
Expand Down

0 comments on commit 8f5c6af

Please sign in to comment.