@@ -42,23 +42,19 @@ TEST(ArrayInterface, Error) {
|
||||
std::string typestr{"<f4"};
|
||||
|
||||
// missing version
|
||||
EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj,
|
||||
StringView{typestr}, shape),
|
||||
EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj, shape),
|
||||
dmlc::Error);
|
||||
column["version"] = Integer(static_cast<Integer::Int>(1));
|
||||
// missing data
|
||||
EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj,
|
||||
StringView{typestr}, shape),
|
||||
EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj, shape),
|
||||
dmlc::Error);
|
||||
column["data"] = j_data;
|
||||
// missing typestr
|
||||
EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj,
|
||||
StringView{typestr}, shape),
|
||||
EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj, shape),
|
||||
dmlc::Error);
|
||||
column["typestr"] = String("<f4");
|
||||
// nullptr is not valid
|
||||
EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj,
|
||||
StringView{typestr}, shape),
|
||||
EXPECT_THROW(ArrayInterfaceHandler::ExtractData(column_obj, shape),
|
||||
dmlc::Error);
|
||||
|
||||
HostDeviceVector<float> storage;
|
||||
@@ -67,8 +63,7 @@ TEST(ArrayInterface, Error) {
|
||||
Json(Integer(reinterpret_cast<Integer::Int>(storage.ConstHostPointer()))),
|
||||
Json(Boolean(false))};
|
||||
column["data"] = j_data;
|
||||
EXPECT_NO_THROW(ArrayInterfaceHandler::ExtractData(
|
||||
column_obj, StringView{typestr}, shape));
|
||||
EXPECT_NO_THROW(ArrayInterfaceHandler::ExtractData(column_obj, shape));
|
||||
}
|
||||
|
||||
TEST(ArrayInterface, GetElement) {
|
||||
|
||||
@@ -232,6 +232,7 @@ class TestBasic:
|
||||
assert isinstance(cv, dict)
|
||||
assert len(cv) == (4)
|
||||
|
||||
@pytest.mark.skipif(**tm.skip_s390x())
|
||||
def test_cv_explicit_fold_indices_labels(self):
|
||||
params = {'max_depth': 2, 'eta': 1, 'verbosity': 0, 'objective':
|
||||
'reg:squarederror'}
|
||||
|
||||
@@ -11,6 +11,7 @@ import pytest
|
||||
import tempfile
|
||||
import xgboost as xgb
|
||||
import numpy as np
|
||||
import platform
|
||||
|
||||
hypothesis = pytest.importorskip('hypothesis')
|
||||
sklearn = pytest.importorskip('sklearn')
|
||||
@@ -136,6 +137,12 @@ def no_multiple(*args):
|
||||
return {'condition': condition, 'reason': reason}
|
||||
|
||||
|
||||
def skip_s390x():
|
||||
condition = platform.machine() == "s390x"
|
||||
reason = "Known to fail on s390x"
|
||||
return {"condition": condition, "reason": reason}
|
||||
|
||||
|
||||
# Contains a dataset in numpy format as well as the relevant objective and metric
|
||||
class TestDataset:
|
||||
def __init__(self, name, get_dataset, objective, metric
|
||||
|
||||
@@ -103,5 +103,5 @@ if [ ${TASK} == "s390x_test" ]; then
|
||||
# Run model compatibility tests
|
||||
cd ..
|
||||
python3 -m pip install --user pytest hypothesis
|
||||
PYTHONPATH=./python-package python3 -m pytest --fulltrace -v -rxXs tests/python/ -k 'test_model'
|
||||
PYTHONPATH=./python-package python3 -m pytest --fulltrace -v -rxXs tests/python/test_basic.py
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user