-
Notifications
You must be signed in to change notification settings - Fork 48.1k
fix(windows): native Windows correctness fixes + green CLI test suite #57016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
lEWFkRAD
wants to merge
6
commits into
NousResearch:main
from
lEWFkRAD:fix/windows-native-test-suite
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
49db92a
fix(gateway): match profile command lines across path separator styles
lEWFkRAD f9ca58c
fix(cli): Windows drive-letter file:// URIs and POSIX-literal path joins
lEWFkRAD abc579c
fix(cli): do not crash cprint when stdout has no console
lEWFkRAD 05c2a30
test(windows): make the CLI test suite pass on native Windows
lEWFkRAD a6f6e24
test(windows): cover URI banner and WSL path fixes
lEWFkRAD d291bcc
fix(tests): restore complete banner coverage
lEWFkRAD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| """Shared fixtures for tests/cli. | ||
|
|
||
| Several test modules here build a HermesCLI via ``importlib.reload(cli)`` | ||
| with prompt_toolkit stubbed out in ``sys.modules`` (the ``_make_cli`` | ||
| pattern from test_cli_init.py). ``importlib.reload()`` re-executes cli.py | ||
| into the SAME module dict, so those MagicMock bindings (``_pt_print``, | ||
| ``_PT_ANSI``, ...) survive the ``patch.dict`` context and silently break | ||
| any later test that needs cli's real prompt_toolkit machinery — e.g. | ||
| ``cli._cprint`` output vanishes into a MagicMock and capsys sees nothing. | ||
|
|
||
| The autouse fixture below restores the real bindings at each module | ||
| boundary by re-reloading cli (with the real prompt_toolkit back in | ||
| sys.modules) whenever the pollution is detected. | ||
| """ | ||
|
|
||
| import importlib | ||
| import sys | ||
| from unittest.mock import MagicMock | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True, scope="module") | ||
| def _unpollute_cli_module(): | ||
| yield | ||
| cli_mod = sys.modules.get("cli") | ||
| if cli_mod is not None and isinstance( | ||
| getattr(cli_mod, "_pt_print", None), MagicMock | ||
| ): | ||
| importlib.reload(cli_mod) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a focused regression test that makes
print_formatted_textraise and verifies this fallback emits through plainprint; no banner test is changed by this PR.