|
22 | 22 | from pandas.io.common import URLError
|
23 | 23 | from pandas.io.excel import (
|
24 | 24 | ExcelFile, ExcelWriter, _OpenpyxlWriter, _XlsxWriter, _XlwtWriter,
|
25 |
| - read_excel, register_writer) |
| 25 | + read_excel) |
26 | 26 | from pandas.io.formats.excel import ExcelFormatter
|
27 | 27 | from pandas.io.parsers import read_csv
|
28 | 28 |
|
@@ -2350,44 +2350,6 @@ def test_ExcelWriter_dispatch_raises(self):
|
2350 | 2350 | with pytest.raises(ValueError, match='No engine'):
|
2351 | 2351 | ExcelWriter('nothing')
|
2352 | 2352 |
|
2353 |
| - @pytest.mark.filterwarnings("ignore:\\nPanel:FutureWarning") |
2354 |
| - def test_register_writer(self): |
2355 |
| - # some awkward mocking to test out dispatch and such actually works |
2356 |
| - called_save = [] |
2357 |
| - called_write_cells = [] |
2358 |
| - |
2359 |
| - class DummyClass(ExcelWriter): |
2360 |
| - called_save = False |
2361 |
| - called_write_cells = False |
2362 |
| - supported_extensions = ['test', 'xlsx', 'xls'] |
2363 |
| - engine = 'dummy' |
2364 |
| - |
2365 |
| - def save(self): |
2366 |
| - called_save.append(True) |
2367 |
| - |
2368 |
| - def write_cells(self, *args, **kwargs): |
2369 |
| - called_write_cells.append(True) |
2370 |
| - |
2371 |
| - def check_called(func): |
2372 |
| - func() |
2373 |
| - assert len(called_save) >= 1 |
2374 |
| - assert len(called_write_cells) >= 1 |
2375 |
| - del called_save[:] |
2376 |
| - del called_write_cells[:] |
2377 |
| - |
2378 |
| - with pd.option_context('io.excel.xlsx.writer', 'dummy'): |
2379 |
| - register_writer(DummyClass) |
2380 |
| - writer = ExcelWriter('something.test') |
2381 |
| - assert isinstance(writer, DummyClass) |
2382 |
| - df = tm.makeCustomDataframe(1, 1) |
2383 |
| - |
2384 |
| - func = lambda: df.to_excel('something.test') |
2385 |
| - check_called(func) |
2386 |
| - check_called(lambda: df.to_excel('something.xlsx')) |
2387 |
| - check_called( |
2388 |
| - lambda: df.to_excel( |
2389 |
| - 'something.xls', engine='dummy')) |
2390 |
| - |
2391 | 2353 |
|
2392 | 2354 | @pytest.mark.parametrize('engine', [
|
2393 | 2355 | pytest.param('xlwt',
|
|
0 commit comments