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
3 changes: 3 additions & 0 deletions src/mdxify/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ def main():

args = parser.parse_args()

# Show version banner for easier debugging and support requests
print(f"mdxify version {__version__}")

# Configure logging based on verbosity
if args.verbose:
# Show all warnings when verbose
Expand Down
11 changes: 7 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_skip_empty_parents_flag():
assert args.skip_empty_parents is True


def test_cli_processes_specified_modules():
def test_cli_processes_specified_modules(capsys):
"""Test processing specific modules."""
with patch("mdxify.cli.find_all_modules") as mock_find, \
patch("mdxify.cli.get_module_source_file") as mock_source, \
Expand All @@ -94,9 +94,12 @@ def test_cli_processes_specified_modules():
# Run
with pytest.raises(SystemExit) as exc_info:
main()

assert exc_info.value.code == 0 # type: ignore


captured = capsys.readouterr()
assert f"mdxify version {__version__}" in captured.out

# Verify module was processed
mock_parse.assert_called_once_with("mypackage.core", Path("mypackage/core.py"), False)
mock_generate.assert_called_once()
Expand Down Expand Up @@ -277,4 +280,4 @@ def test_include_internal():
assert "mypackage.flows._private" in processed_modules

# Should have processed 4 modules total
assert len(processed_modules) == 4
assert len(processed_modules) == 4