"tests/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "07d7b7972f582f0f418d06c34dc0b5728b0428d4"
conftest.py 480 Bytes
Newer Older
1
2
3
import numpy as np
import pytest

4
5
6
7
8
9
10
11
12
import lightgbm


@pytest.fixture(scope="function")
def missing_module_cffi(monkeypatch):
    """Mock 'cffi' not being importable"""
    monkeypatch.setattr(lightgbm.compat, "CFFI_INSTALLED", False)
    monkeypatch.setattr(lightgbm.basic, "CFFI_INSTALLED", False)

13
14
15
16
17
18
19
20
21

@pytest.fixture(scope="function")
def rng():
    return np.random.default_rng()


@pytest.fixture(scope="function")
def rng_fixed_seed():
    return np.random.default_rng(seed=42)