Skip to content

Commit

Permalink
Simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Feb 2, 2024
1 parent 5a95e7f commit 02ff377
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

34 changes: 10 additions & 24 deletions tests/test_release.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pathlib

import pytest

from galaxy_release_util.point_release import (
Expand All @@ -20,32 +22,16 @@
"""


@pytest.fixture(scope="session")
def make_version_file():
def f(root):
file = root / "lib" / "galaxy" / "version.py"
file.parent.mkdir(parents=True)
file.write_text(VERSION_PY_CONTENTS)

return f


@pytest.fixture(scope="session")
def make_packages_file():
def f(root):
file = root / "packages" / "packages_by_dep_dag.txt"
file.parent.mkdir(parents=True)
file.write_text(PACKAGES_BY_DEP_DAG_CONTENTS)

return f
def write_contents(path: pathlib.Path, contents: str):
path.parent.mkdir(parents=True)
path.write_text(contents)


@pytest.fixture(scope="session")
def galaxy_root(tmp_path_factory, make_version_file, make_packages_file):
tmp_root = tmp_path_factory.mktemp("galaxy_root")
make_version_file(tmp_root)
make_packages_file(tmp_root)
return tmp_root
@pytest.fixture()
def galaxy_root(tmp_path: pathlib.Path):
write_contents(tmp_path / "lib" / "galaxy" / "version.py", VERSION_PY_CONTENTS)
write_contents(tmp_path / "packages" / "packages_by_dep_dag.txt", PACKAGES_BY_DEP_DAG_CONTENTS)
return tmp_path


def test_get_root_version(galaxy_root):
Expand Down

0 comments on commit 02ff377

Please sign in to comment.