MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / detect_test_framework

Method detect_test_framework

core/preferences.py:126–133  ·  view source on GitHub ↗

Detect test framework from file content.

(cls, content: str)

Source from the content-addressed store, hash-verified

124
125 @classmethod
126 def detect_test_framework(cls, content: str) -> Optional[str]:
127 """Detect test framework from file content."""
128 scores = defaultdict(int)
129 for framework, patterns in cls.TEST_FRAMEWORKS.items():
130 for pattern in patterns:
131 if re.search(pattern, content, re.MULTILINE):
132 scores[framework] += 1
133 return max(scores, key=scores.get) if scores else None
134
135 @classmethod
136 def detect_code_style(cls, content: str) -> Optional[str]:

Callers 3

test_detect_pytestMethod · 0.80
test_detect_unittestMethod · 0.80

Calls 1

searchMethod · 0.45

Tested by 2

test_detect_pytestMethod · 0.64
test_detect_unittestMethod · 0.64