File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 14
14
from pyexcel_xls .xlsr import xldate_to_python_date
15
15
from pyexcel_xls .xlsw import XLSWriter as Writer
16
16
17
- from nose .tools import eq_ , raises
18
17
import pytest
19
18
20
19
IN_TRAVIS = "TRAVIS" in os .environ
@@ -66,9 +65,9 @@ def custom_row_renderer(row):
66
65
save_data ("test.xls" , {"sheet" : data_gen ()})
67
66
68
67
69
- @raises (IOError )
70
68
def test_issue_13_empty_file_content ():
71
- pe .get_sheet (file_content = "" , file_type = "xls" )
69
+ with pytest .raises (IOError ):
70
+ pe .get_sheet (file_content = "" , file_type = "xls" )
72
71
73
72
74
73
def test_issue_16_file_stream_has_no_getvalue ():
@@ -107,13 +106,13 @@ def test_issue_151():
107
106
assert "#N/A" == s [0 , 0 ]
108
107
109
108
110
- @raises (NotImplementedError )
111
109
def test_empty_book_pyexcel_issue_120 ():
112
110
"""
113
111
https://github.com/pyexcel/pyexcel/issues/120
114
112
"""
115
- writer = Writer ("fake.xls" , "xls" )
116
- writer .write ({})
113
+ with pytest .raises (NotImplementedError ):
114
+ writer = Writer ("fake.xls" , "xls" )
115
+ writer .write ({})
117
116
118
117
119
118
def test_pyexcel_issue_54 ():
Original file line number Diff line number Diff line change 4
4
import pyexcel
5
5
from base import PyexcelMultipleSheetBase
6
6
7
- from nose . tools import raises
7
+ import pytest
8
8
9
9
if sys .version_info [0 ] == 2 and sys .version_info [1 ] < 7 :
10
10
from ordereddict import OrderedDict
@@ -53,13 +53,13 @@ def test_load_a_single_sheet2(self):
53
53
assert len (b1 .sheet_names ()) == 1
54
54
assert b1 ["Sheet1" ].to_array () == self .content ["Sheet1" ]
55
55
56
- @raises (IndexError )
57
56
def test_load_a_single_sheet3 (self ):
58
- pyexcel .get_book (file_name = self .testfile , sheet_index = 10000 )
57
+ with pytest .raises (IndexError ):
58
+ pyexcel .get_book (file_name = self .testfile , sheet_index = 10000 )
59
59
60
- @raises (ValueError )
61
60
def test_load_a_single_sheet4 (self ):
62
- pyexcel .get_book (file_name = self .testfile , sheet_name = "Not exist" )
61
+ with pytest .raises (ValueError ):
62
+ pyexcel .get_book (file_name = self .testfile , sheet_name = "Not exist" )
63
63
64
64
def test_delete_sheets (self ):
65
65
b1 = pyexcel .load_book (self .testfile )
You can’t perform that action at this time.
0 commit comments