fix: Add interactive parameter to prevent stdin read during tests

Fixes 2 failing tests in test_architecture_scenarios.py that were trying to
read from stdin during pytest execution, causing:
  OSError: pytest: reading from stdin while output is captured!

Changes:
- Added 'interactive' parameter to UnifiedCodebaseAnalyzer.analyze() (defaults to True)
- Pass interactive flag through to _analyze_github() and GitHubThreeStreamFetcher
- Updated failing tests to pass interactive=False

Tests fixed:
- test_scenario_1_github_three_stream_fetcher
- test_scenario_1_unified_analyzer_github

The interactive parameter controls whether the code prompts the user for
input (e.g., 'Continue without token?'). Setting it to False prevents
input() calls, making the code safe for CI/CD and test environments.

All 1386 tests now pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-01-17 22:02:35 +03:00
parent b837244e42
commit 02be4c53f6
2 changed files with 8 additions and 5 deletions

View File

@@ -202,7 +202,7 @@ How to use async tools.
return_value=mock_github_api_data["issues"],
),
):
fetcher = GitHubThreeStreamFetcher("https://github.com/jlowin/fastmcp")
fetcher = GitHubThreeStreamFetcher("https://github.com/jlowin/fastmcp", interactive=False)
three_streams = fetcher.fetch()
# Verify 3 streams exist
@@ -268,7 +268,7 @@ How to use async tools.
analyzer = UnifiedCodebaseAnalyzer()
result = analyzer.analyze(
source="https://github.com/jlowin/fastmcp", depth="c3x", fetch_github_metadata=True
source="https://github.com/jlowin/fastmcp", depth="c3x", fetch_github_metadata=True, interactive=False
)
# Verify result structure