fix: Resolve PDF processing (#267), How-To Guide (#242), Chinese README (#260) + code quality (#273)

Thanks @franklegolasyoung for the excellent work on the core fixes for issues #267, #242, and #260! 🙏

Your comprehensive approach to fixing PDF processing, expanding workflow detection, and improving the Chinese README documentation is much appreciated. I've added code quality fixes and comprehensive tests to ensure everything passes CI.

All 1266+ tests are now passing, and the issues are resolved! 🎉
This commit is contained in:
yusyus
2026-01-31 21:30:00 +03:00
committed by GitHub
parent f726a9abc5
commit 91bd2184e5
19 changed files with 622 additions and 174 deletions

View File

@@ -577,8 +577,36 @@ class PythonTestAnalyzer:
def _is_integration_test(self, func_node: ast.FunctionDef) -> bool:
"""Check if test looks like an integration test"""
test_name = func_node.name.lower()
integration_keywords = ["workflow", "integration", "end_to_end", "e2e", "full"]
return any(keyword in test_name for keyword in integration_keywords)
# Expanded keyword list for better workflow detection
integration_keywords = [
"workflow",
"integration",
"end_to_end",
"e2e",
"full",
"complete",
"scenario",
"flow",
"multi_step",
"multistep",
"process",
"chain",
"sequence",
"pipeline",
"lifecycle",
]
# Check test name for keywords
if any(keyword in test_name for keyword in integration_keywords):
return True
# Heuristic: tests with 4+ assignments and 3+ calls are likely workflows
assignments = sum(
1 for n in ast.walk(func_node) if isinstance(n, (ast.Assign, ast.AugAssign))
)
calls = sum(1 for n in ast.walk(func_node) if isinstance(n, ast.Call))
return assignments >= 4 and calls >= 3
def _extract_assertion_after(self, func_node: ast.FunctionDef, target_node: ast.AST) -> str:
"""Find assertion that follows the target node"""
@@ -771,7 +799,11 @@ class GenericTestAnalyzer:
# Find next method (setup or test)
next_pattern = patterns.get("setup", patterns["test_function"])
next_setup = re.search(next_pattern, code[setup_start:])
setup_end = setup_start + next_setup.start() if next_setup else min(setup_start + 500, len(code))
setup_end = (
setup_start + next_setup.start()
if next_setup
else min(setup_start + 500, len(code))
)
setup_body = code[setup_start:setup_end]
example = self._create_example(