Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
f2695dab
Unverified
Commit
f2695dab
authored
Jan 15, 2021
by
Nikita Titov
Committed by
GitHub
Jan 15, 2021
Browse files
completely remove tempfile from test_basic (#3767)
parent
f6d2dce4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
tests/python_package_test/test_basic.py
tests/python_package_test/test_basic.py
+1
-3
No files found.
tests/python_package_test/test_basic.py
View file @
f2695dab
# coding: utf-8
import
os
import
tempfile
import
lightgbm
as
lgb
import
numpy
as
np
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment