Skip to content

refactor: reset jubilant before the bad-token tests - #209

Merged
dwilding merged 1 commit into
mainfrom
reset-jubilant-before-bad-token-tests
Oct 27, 2026
Merged

dwilding merged 1 commit into
mainfrom
reset-jubilant-before-bad-token-tests

Conversation

@dwilding

Copy link
Copy Markdown
Owner

What

Follow-up to #208. The bad-token tests assert that nothing is created on disk when the CLI rejects a token. #208 gave them a dedicated, function-scoped dir. This PR drops that fixture and instead has each test remove jubilant from the module-wide test_dir before running, restoring the strict assertion.

Why

  • One idiom: the module keeps its single test_dir fixture, matching test_git_errors.py, which also shares one dir across tests.
  • Order independence: the reset happens at test start, so test definition order no longer matters (unlike a sequencing approach).
  • Less machinery: no second fixture to explain.

Removing jubilant is safe for the rest of the module: the remaining tests each clone their own branch fresh and don't read each other's clones.

Validation

  • Full module with a live token: 6/6 pass (the reset path is genuinely exercised, as test_forked_repo_token runs first and creates jubilant).
  • Reversed order (test_bad_token_no_owner before test_forked_repo_token): passes.
  • ruff check + format: clean.

Follow-up to #208. Instead of giving the bad-token tests their own dir,
have each remove jubilant from the module-wide test dir before running.
The tests stay order-independent with the module's single fixture and
one idiom (test_git_errors.py shares state across tests in the same dir),
and no extra fixture is needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dwilding
dwilding merged commit 388f0ed into main Oct 27, 2026
14 checks passed
@dwilding
dwilding deleted the reset-jubilant-before-bad-token-tests branch October 27, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant