Commit Graph

4 Commits

Author SHA1 Message Date
yusyus
ec3e0bf491 fix: Resolve 61 critical linting errors
Fixed priority linting errors to improve code quality:

Critical Fixes:
- F821 (2 errors): Fixed undefined name 'original_result' in config_enhancer.py
- UP035 (2 errors): Removed deprecated typing.Dict and typing.Type imports
- F401 (27 errors): Removed unused imports and added noqa for availability checks
- E722 (19 errors): Replaced bare 'except:' with 'except Exception:'

Code Quality Improvements:
- SIM201 (4 errors): Simplified 'not x == y' to 'x != y'
- SIM118 (2 errors): Removed unnecessary .keys() in dict iterations
- E741 (4 errors): Renamed ambiguous variable 'l' to 'line'
- I001 (1 error): Sorted imports in test_bootstrap_skill.py

All modified areas tested and passing:
- test_scraper_features.py: 42 passed
- test_integration.py: 51 passed
- test_architecture_scenarios.py: 11 passed
- test_real_world_fastmcp.py: 19 passed (1 skipped)

Remaining linting errors: 249 (mostly code style suggestions like ARG002, F841, SIM102)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-17 22:54:40 +03:00
Pablo Estevez
5ed767ff9a run ruff 2026-01-17 17:29:21 +00:00
yusyus
119e642ced fix: Add package installation check and fix test imports (Task 2.1)
Fixes test import errors in 7 test files that failed without package installed.

**Changes:**

1. **tests/conftest.py** - Added pytest_configure() hook
   - Checks if skill_seekers package is installed before running tests
   - Shows helpful error message guiding users to run `pip install -e .`
   - Prevents confusing ModuleNotFoundError during test runs

2. **tests/test_constants.py** - Fixed dynamic imports
   - Changed `from cli import` to `from skill_seekers.cli import` (6 locations)
   - Fixes imports in test methods that dynamically import modules
   - All 16 tests now pass 

3. **tests/test_llms_txt_detector.py** - Fixed patch decorators
   - Changed `patch('cli.llms_txt_detector.` to `patch('skill_seekers.cli.llms_txt_detector.` (4 locations)
   - All 4 tests now pass 

4. **docs/CLAUDE.md** - Added "Running Tests" section
   - Clear instructions on installing package before testing
   - Explanation of why installation is required
   - Common pytest commands and options
   - Test coverage statistics

**Testing:**
-  All 101 tests pass across the 7 affected files:
  - test_async_scraping.py (11 tests)
  - test_config_validation.py (26 tests)
  - test_constants.py (16 tests)
  - test_estimate_pages.py (8 tests)
  - test_integration.py (23 tests)
  - test_llms_txt_detector.py (4 tests)
  - test_llms_txt_downloader.py (13 tests)
-  conftest.py check works correctly
-  Helpful error shown when package not installed

**Impact:**
- Developers now get clear guidance when tests fail due to missing installation
- All test import issues resolved
- Better developer experience for contributors
2025-11-29 22:13:13 +03:00
yusyus
a9c07a66ad Fix GitHub Actions test failures for unified MCP integration
Fixed async test issues that were causing CI failures.

## Issue:
GitHub Actions tests were failing with:
- 4 FAILED tests/test_unified_mcp_integration.py (async def functions not supported)
- 346 passed tests

## Root Cause:
The new test_unified_mcp_integration.py file had async test functions without proper pytest-anyio configuration, causing pytest to fail when trying to run them.

## Fix:

1. **Added pytest.mark.anyio markers**
   - Added module-level pytestmark = pytest.mark.anyio
   - Ensures all async functions are recognized by anyio plugin

2. **Created tests/conftest.py**
   - Overrides anyio_backend fixture to use only 'asyncio'
   - Prevents tests from attempting to use 'trio' backend (not installed)
   - Reduces test duplication (was running each test for both asyncio + trio)

3. **Updated README.md**
   - Already pushed in previous commit (b4f9052)
   - Updated descriptions to reflect GitHub scraping capability

## Test Results:

**Before Fix:**
- 4 failed, 346 passed (in CI)
- Error: "async def functions are not natively supported"

**After Fix:**
- 4 passed tests/test_unified_mcp_integration.py
- All tests use asyncio backend only
- No trio-related errors

## Files Changed:

1. tests/test_unified_mcp_integration.py
   - Added pytestmark = pytest.mark.anyio at module level
   - All 4 async test functions now properly marked

2. tests/conftest.py (NEW)
   - Created pytest configuration file
   - Overrides anyio_backend to 'asyncio' only
   - Prevents unnecessary test duplication

## Verification:

Local test run successful:
```
tests/test_unified_mcp_integration.py::test_mcp_validate_unified_config PASSED
tests/test_unified_mcp_integration.py::test_mcp_validate_legacy_config PASSED
tests/test_unified_mcp_integration.py::test_mcp_scrape_docs_detection PASSED
tests/test_unified_mcp_integration.py::test_mcp_merge_mode_override PASSED
4 passed in 0.21s
```

Expected CI result: 350/350 tests passing (up from 346/350)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 17:19:06 +03:00