|
6 | 6 | import os
|
7 | 7 | import sys
|
8 | 8 | import datetime
|
9 |
| -import psutil |
10 | 9 | from textwrap import dedent
|
11 | 10 | import pyexcel as pe
|
12 | 11 | from pyexcel_xlsx.xlsxr import get_columns
|
13 | 12 | from pyexcel.internal.sheets._shared import excel_column_index
|
14 | 13 | from nose.tools import eq_
|
15 |
| -from platform import python_implementation |
16 | 14 |
|
17 | 15 |
|
18 | 16 | PY36_ABOVE = sys.version_info[0] == 3 and sys.version_info[1] >= 6
|
@@ -141,53 +139,5 @@ def test_issue_8_hidden_sheet_2():
|
141 | 139 | eq_(book_dict['hidden'], [['a', 'b']])
|
142 | 140 |
|
143 | 141 |
|
144 |
| -def test_issue_14_xlsx_file_handle(): |
145 |
| - if python_implementation == 'PyPy': |
146 |
| - return |
147 |
| - if PY36_ABOVE: |
148 |
| - return |
149 |
| - proc = psutil.Process() |
150 |
| - test_file = os.path.join("tests", "fixtures", "hidden_sheets.xlsx") |
151 |
| - open_files_l1 = proc.open_files() |
152 |
| - |
153 |
| - # start with a csv file |
154 |
| - data = pe.iget_array(file_name=test_file, library='pyexcel-xlsx') |
155 |
| - open_files_l2 = proc.open_files() |
156 |
| - delta = len(open_files_l2) - len(open_files_l1) |
157 |
| - # interestingly, file is already open :) |
158 |
| - assert delta == 1 |
159 |
| - |
160 |
| - # now the file handle get opened when we run through |
161 |
| - # the generator |
162 |
| - list(data) |
163 |
| - open_files_l3 = proc.open_files() |
164 |
| - delta = len(open_files_l3) - len(open_files_l1) |
165 |
| - # caught an open file handle, the "fish" finally |
166 |
| - assert delta == 1 |
167 |
| - |
168 |
| - # free the fish |
169 |
| - pe.free_resources() |
170 |
| - open_files_l4 = proc.open_files() |
171 |
| - # this confirms that no more open file handle |
172 |
| - eq_(open_files_l1, open_files_l4) |
173 |
| - |
174 |
| - |
175 |
| -def test_issue_83_file_handle_no_generator(): |
176 |
| - if python_implementation == 'PyPy': |
177 |
| - return |
178 |
| - proc = psutil.Process() |
179 |
| - test_files = [ |
180 |
| - os.path.join("tests", "fixtures", "hidden_sheets.xlsx") |
181 |
| - ] |
182 |
| - for test_file in test_files: |
183 |
| - open_files_l1 = proc.open_files() |
184 |
| - # start with a csv file |
185 |
| - pe.get_array(file_name=test_file) |
186 |
| - open_files_l2 = proc.open_files() |
187 |
| - delta = len(open_files_l2) - len(open_files_l1) |
188 |
| - # no open file handle should be left |
189 |
| - assert delta == 0 |
190 |
| - |
191 |
| - |
192 | 142 | def get_fixtures(file_name):
|
193 | 143 | return os.path.join("tests", "fixtures", file_name)
|
0 commit comments