File size: 831 Bytes
fb03edc
324d83a
1aaf3fc
 
 
 
 
feab4b2
1aaf3fc
 
fb03edc
 
 
1aaf3fc
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from tests.candidate import complete_interview
from tests.grader import grade
from concurrent.futures import ThreadPoolExecutor


def complete_and_grade_interview(interview_type):
    file_path, _ = complete_interview(interview_type, "test", model="gpt-3.5-turbo")
    feedback = grade(file_path, model="gpt-4o")
    assert feedback["overall_score"] > 0.4
    return feedback["overall_score"]


def test_complete_interview():
    interview_types = ["ml_design", "math", "ml_theory", "system_design", "sql", "coding"]
    scores = []

    with ThreadPoolExecutor(max_workers=3) as executor:
        futures = [executor.submit(complete_and_grade_interview, it) for it in interview_types]

        for future in futures:
            score = future.result()
            scores.append(score)

    assert sum(scores) / len(scores) > 0.6