Skip to content

Commit e294c36

Browse files
TST flushing not needed when existing file context manager
1 parent 2f2413d commit e294c36

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

civis/tests/test_io.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ def test_large_file_to_civis(self, *mocks):
135135
fname = os.path.join(temp_dir, 'tempfile')
136136
with open(fname, 'w+b') as tmp:
137137
tmp.write(b'a,b,c\n1,2,3')
138-
tmp.flush()
139-
tmp.seek(0)
138+
with open(fname, 'r+b') as tmp:
140139
result = civis.io.file_to_civis(tmp, fname)
141140

142141
civis.io._files.MIN_MULTIPART_SIZE = curr_size
@@ -156,7 +155,6 @@ def test_csv_to_civis(self, *mocks):
156155
fname = os.path.join(temp_dir, 'tempfile')
157156
with open(fname, 'w+b') as tmp:
158157
tmp.write(b'a,b,c\n1,2,3')
159-
tmp.flush()
160158

161159
table = "scratch.api_client_test_fixture"
162160
database = 'redshift-general'

0 commit comments

Comments
 (0)