Unverified Commit f2695dab authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

completely remove tempfile from test_basic (#3767)

parent f6d2dce4
# coding: utf-8 # coding: utf-8
import os import os
import tempfile
import lightgbm as lgb import lightgbm as lgb
import numpy as np import numpy as np
...@@ -268,8 +267,7 @@ def test_cegb_affects_behavior(tmp_path): ...@@ -268,8 +267,7 @@ def test_cegb_affects_behavior(tmp_path):
base = lgb.Booster(train_set=ds) base = lgb.Booster(train_set=ds)
for k in range(10): for k in range(10):
base.update() base.update()
with tempfile.NamedTemporaryFile() as f: basename = str(tmp_path / "basename.txt")
basename = f.name
base.save_model(basename) base.save_model(basename)
with open(basename, 'rt') as f: with open(basename, 'rt') as f:
basetxt = f.read() basetxt = f.read()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment