Code Duplication    Length = 21-21 lines in 2 locations

tests/test_random_state.py 2 locations

@@ 74-94 (lines=21) @@
71
    assert int(len(results) / n_jobs) != len(no_dup)
72
73
74
def test_random_state_n_jobs_2():
75
    """Test random state behavior with n_jobs=4."""
76
    n_jobs = 4
77
78
    hyper = Hyperactive()
79
    hyper.add_search(
80
        objective_function,
81
        search_space,
82
        n_iter=5,
83
        initialize={"random": 1},
84
        random_state=1,
85
        n_jobs=n_jobs,
86
    )
87
    hyper.run()
88
89
    results = hyper.search_data(objective_function)
90
91
    no_dup = results.drop_duplicates(subset=list(search_space.keys()))
92
    print("no_dup", no_dup)
93
    print("results", results)
94
95
    assert int(len(results) / n_jobs) != len(no_dup)
96
97
@@ 50-70 (lines=21) @@
47
    assert int(len(results) / n_jobs) != len(no_dup)
48
49
50
def test_random_state_n_jobs_1():
51
    """Test random state behavior with n_jobs=3."""
52
    n_jobs = 3
53
54
    hyper = Hyperactive()
55
    hyper.add_search(
56
        objective_function,
57
        search_space,
58
        n_iter=5,
59
        initialize={"random": 1},
60
        random_state=1,
61
        n_jobs=n_jobs,
62
    )
63
    hyper.run()
64
65
    results = hyper.search_data(objective_function)
66
67
    no_dup = results.drop_duplicates(subset=list(search_space.keys()))
68
    print("no_dup", no_dup)
69
    print("results", results)
70
71
    assert int(len(results) / n_jobs) != len(no_dup)
72
73