Skip to content

fix(tests): isolate global SOUL.md in test_empty_dir_returns_empty#426

Closed
teyrebaz33 wants to merge 2 commits into
NousResearch:mainfrom
teyrebaz33:fix/test-prompt-builder-soul-isolation
Closed

fix(tests): isolate global SOUL.md in test_empty_dir_returns_empty#426
teyrebaz33 wants to merge 2 commits into
NousResearch:mainfrom
teyrebaz33:fix/test-prompt-builder-soul-isolation

Conversation

@teyrebaz33

Copy link
Copy Markdown
Contributor

Problem

test_empty_dir_returns_empty was failing on any system where ~/.hermes/SOUL.md exists. The function build_context_files_prompt() correctly falls back to the global ~/.hermes/SOUL.md when no SOUL.md is found in cwd — but the test didn't account for this, so it failed with a non-empty result.

Fix

Added monkeypatch to redirect Path.home() to tmp_path so the test is fully isolated from the user's home directory.

Reproduce

# Create a global SOUL.md
echo 'test' > ~/.hermes/SOUL.md

# Run the test — it fails
python3 -m pytest tests/agent/test_prompt_builder.py::TestBuildContextFilesPrompt::test_empty_dir_returns_empty

Result after fix

31 passed in 0.21s

Thin skill file that wraps the pokemon-agent pip package.
All emulation logic lives in NousResearch/pokemon-agent.

- Gameplay loop: observe/orient/decide/act/verify/record/save
- Battle strategy with Gen 1 quirks and type chart
- Memory conventions with PKM: prefix
- Progression milestones (all 8 badges + Elite Four)
- Session save/load lifecycle
- Dashboard reference (localhost:8765/dashboard)
The test was failing when ~/.hermes/SOUL.md exists on the system
because build_context_files_prompt() falls back to the global
SOUL.md when none is found in cwd. Added monkeypatch to redirect
Path.home() to tmp_path so the test is fully isolated.
@teknium1

teknium1 commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

This was already fixed independently in commit 2a68099 (fix(tests): isolate tests from user ~/.hermes/ config and SOUL.md). The test now patches Path.home to a fake directory.

Also note: this PR bundles an unrelated Pokemon player skill that shouldn't be in a test-fix PR.

Closing as already resolved.

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.

2 participants