Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,3 @@ def uv_run():
@pytest.fixture(scope="module")
def test_dir(tmp_path_factory):
yield tmp_path_factory.mktemp("functional")


@pytest.fixture()
def fresh_dir(tmp_path_factory):
# A dir no other test has touched. Use it in tests that assert nothing is created.
yield tmp_path_factory.mktemp("functional")
17 changes: 11 additions & 6 deletions tests/functional/test_token.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import shutil
import subprocess

import helpers_functional as helpers
Expand Down Expand Up @@ -69,7 +70,9 @@ def test_invalid_repo_token(uv_run, test_dir):
assert not (test_dir / "invalid").exists()


def test_bad_token_no_owner(uv_run, fresh_dir):
def test_bad_token_no_owner(uv_run, test_dir):
# An earlier test in this module may have created jubilant.
shutil.rmtree(test_dir / "jubilant", ignore_errors=True)
command = [
*uv_run,
"gimmegit",
Expand All @@ -78,7 +81,7 @@ def test_bad_token_no_owner(uv_run, fresh_dir):
]
result = subprocess.run(
command,
cwd=fresh_dir,
cwd=test_dir,
env=helpers.bad_token_env(),
capture_output=True,
text=True,
Expand All @@ -93,10 +96,12 @@ def test_bad_token_no_owner(uv_run, fresh_dir):
Error: GitHub rejected the token. Has the token expired?
"""
assert result.stderr == expected_stderr
assert not (fresh_dir / "jubilant").exists()
assert not (test_dir / "jubilant").exists()


def test_bad_token_no_upstream_owner(uv_run, fresh_dir):
def test_bad_token_no_upstream_owner(uv_run, test_dir):
# An earlier test in this module may have created jubilant.
shutil.rmtree(test_dir / "jubilant", ignore_errors=True)
command = [
*uv_run,
"gimmegit",
Expand All @@ -105,7 +110,7 @@ def test_bad_token_no_upstream_owner(uv_run, fresh_dir):
]
result = subprocess.run(
command,
cwd=fresh_dir,
cwd=test_dir,
env=helpers.bad_token_env(),
capture_output=True,
text=True,
Expand All @@ -120,7 +125,7 @@ def test_bad_token_no_upstream_owner(uv_run, fresh_dir):
Error: GitHub rejected the token. Has the token expired?
"""
assert result.stderr == expected_stderr
assert not (fresh_dir / "jubilant").exists()
assert not (test_dir / "jubilant").exists()


@pytest.mark.skipif(helpers.token_unset.condition, reason=helpers.token_unset.reason)
Expand Down
Loading