Skip to content

Commit

Permalink
Speed-up test by compiling NYC only once
Browse files Browse the repository at this point in the history
  • Loading branch information
siboehm committed Nov 21, 2021
1 parent 3100582 commit fbf6f82
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
23 changes: 23 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pytest
from lightgbm import Booster

from lleaves import Model


@pytest.fixture(scope="session")
def NYC_llvm():
llvm_model = Model(model_file="tests/models/NYC_taxi/model.txt")
llvm_model.compile()
return llvm_model


@pytest.fixture(scope="session")
def NYC_lgbm():
return Booster(model_file="tests/models/NYC_taxi/model.txt")


@pytest.fixture(scope="session")
def mtpl2_llvm():
llvm_model = Model(model_file="tests/models/mtpl2/model.txt")
llvm_model.compile()
return llvm_model
16 changes: 0 additions & 16 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
from ctypes import POINTER, c_double

import numpy as np
import pytest
from lightgbm import Booster

from lleaves import Model


@pytest.fixture(scope="session")
def NYC_llvm():
llvm_model = Model(model_file="tests/models/NYC_taxi/model.txt")
llvm_model.compile()
return llvm_model


@pytest.fixture(scope="session")
def NYC_lgbm():
return Booster(model_file="tests/models/NYC_taxi/model.txt")


def test_parallel_edgecases(NYC_llvm, NYC_lgbm):
Expand Down

0 comments on commit fbf6f82

Please sign in to comment.