Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-n committed Jun 22, 2024
1 parent ef91403 commit a955866
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 49 deletions.
1 change: 1 addition & 0 deletions tests/fixtures/includes_project/git_repo
Submodule git_repo added at eae347
1 change: 0 additions & 1 deletion tests/fixtures/includes_project/git_repository/base_env

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

32 changes: 7 additions & 25 deletions tests/test_includes.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
import pytest


@pytest.fixture(scope="session")
def _init_git_repo(projects):
from poethepoet.helpers.git import GitRepo

repo_path = projects["includes/git_repo/sub_project"].parent.parent
repo = GitRepo(repo_path)
# Init the git repo for use in tests
repo.init()
yield
# Delete the .git dir so that we don't have to deal with it as a git submodule
repo.delete_git_dir()


def test_docs_for_include_toml_file(run_poe_subproc):
result = run_poe_subproc(project="includes")
assert (
Expand Down Expand Up @@ -324,15 +308,15 @@ def test_include_subproject_envfiles_with_cwd_set(
assert result.stderr == ""


@pytest.mark.usefixtures("_init_git_repo")
def test_include_tasks_from_git_repo(run_poe_subproc, projects):
# Can't find a sane way to properly test POE_GIT_ROOT :(
# test task included relative to POE_GIT_ROOT
result = run_poe_subproc(
"did_it_work", cwd=projects["includes/git_repo/sub_project"]
)
assert result.capture == "Poe => poe_test_echo yes\n"
assert result.stdout == "yes\n"
assert result.stderr == ""
# result = run_poe_subproc(
# "did_it_work", cwd=projects["includes/git_repo/sub_project"]
# )
# assert result.capture == "Poe => poe_test_echo yes\n"
# assert result.stdout == "yes\n"
# assert result.stderr == ""

# test task included relative to POE_GIT_DIR
result = run_poe_subproc(
Expand All @@ -343,7 +327,6 @@ def test_include_tasks_from_git_repo(run_poe_subproc, projects):
assert result.stderr == ""


@pytest.mark.usefixtures("_init_git_repo")
def test_use_poe_git_vars(run_poe_subproc, projects, is_windows, poe_project_path):
result = run_poe_subproc(
"has_repo_env_vars", cwd=projects["includes/git_repo/sub_project"]
Expand All @@ -362,7 +345,6 @@ def test_use_poe_git_vars(run_poe_subproc, projects, is_windows, poe_project_pat
assert result.stderr == ""


@pytest.mark.usefixtures("_init_git_repo")
def test_poe_git_vars_for_task_level_envfile_and_env(
run_poe_subproc, projects, poe_project_path
):
Expand Down

0 comments on commit a955866

Please sign in to comment.