Use pytest conventions consistently (#6337)
* Do not derive from unittest.TestCase (not needed for pytest) * assertRaises -> pytest.raises * Simplify test_empty_dmatrix with test parametrization * setUpClass -> setup_class, tearDownClass -> teardown_class * Don't import unittest; import pytest * Use plain assert * Use parametrized tests in more places * Fix test_gpu_with_sklearn.py * Put back run_empty_dmatrix_reg / run_empty_dmatrix_cls * Fix test_eta_decay_gpu_hist * Add parametrized tests for monotone constraints * Fix test names * Remove test parametrization * Revise test_slice to be not flaky
This commit is contained in:
committed by
GitHub
parent
c763b50dd0
commit
9c9070aea2
@@ -1,15 +1,15 @@
|
||||
import sys
|
||||
import os
|
||||
import unittest
|
||||
import numpy as np
|
||||
import xgboost as xgb
|
||||
import pytest
|
||||
sys.path.append("tests/python")
|
||||
# Don't import the test class, otherwise they will run twice.
|
||||
import test_callback as test_cb # noqa
|
||||
rng = np.random.RandomState(1994)
|
||||
|
||||
|
||||
class TestGPUBasicModels(unittest.TestCase):
|
||||
class TestGPUBasicModels:
|
||||
cputest = test_cb.TestCallbacks()
|
||||
|
||||
def run_cls(self, X, y, deterministic):
|
||||
|
||||
Reference in New Issue
Block a user