Skip to content

Commit ff985c3

Browse files
committed
Rename file instead of re-writing
1 parent f373c1b commit ff985c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ldclient/testing/test_file_data_source.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ def make_temp_file(content):
117117
return path
118118

119119
def replace_file(path, content):
120-
with open(path, 'w') as f:
121-
f.write(content)
120+
temp_path = make_temp_file(content)
121+
os.rename(temp_path, path)
122122

123123
def test_does_not_load_data_prior_to_start():
124124
path = make_temp_file('{"flagValues":{"key":"value"}}')

0 commit comments

Comments
 (0)