Skip to content

Commit

Permalink
completely remove tempfile from test_basic (#3767)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS authored Jan 15, 2021
1 parent f6d2dce commit f2695da
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/python_package_test/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# coding: utf-8
import os
import tempfile

import lightgbm as lgb
import numpy as np
Expand Down Expand Up @@ -268,8 +267,7 @@ def test_cegb_affects_behavior(tmp_path):
base = lgb.Booster(train_set=ds)
for k in range(10):
base.update()
with tempfile.NamedTemporaryFile() as f:
basename = f.name
basename = str(tmp_path / "basename.txt")
base.save_model(basename)
with open(basename, 'rt') as f:
basetxt = f.read()
Expand Down

0 comments on commit f2695da

Please sign in to comment.