@@ -157,8 +157,7 @@ def test_data_path(with_nimd_env):
157
157
with open (tmpfile , 'wt' ) as fobj :
158
158
fobj .write ('[DATA]\n ' )
159
159
fobj .write ('path = %s\n ' % '/path/two' )
160
- assert (get_data_path () ==
161
- tst_list + ['/path/two' ] + old_pth )
160
+ assert get_data_path () == tst_list + ['/path/two' ] + old_pth
162
161
163
162
164
163
def test_find_data_dir ():
@@ -201,10 +200,10 @@ def test_make_datasource(with_nimd_env):
201
200
assert ds .version == '0.1'
202
201
203
202
203
+ @pytest .mark .xfail (raises = DataError )
204
204
def test_bomber ():
205
- with pytest .raises (DataError ):
206
- b = Bomber ('bomber example' , 'a message' )
207
- b .any_attribute # no error
205
+ b = Bomber ('bomber example' , 'a message' )
206
+ b .any_attribute # no error
208
207
209
208
210
209
def test_bomber_inspect ():
@@ -213,13 +212,12 @@ def test_bomber_inspect():
213
212
214
213
215
214
def test_datasource_or_bomber (with_nimd_env ):
216
- pkg_def = dict (
217
- relpath = 'pkg' )
215
+ pkg_def = dict (relpath = 'pkg' )
218
216
with TemporaryDirectory () as tmpdir :
219
217
nibd .get_data_path = lambda : [tmpdir ]
220
218
ds = datasource_or_bomber (pkg_def )
221
219
with pytest .raises (DataError ):
222
- getattr ( ds , ' get_filename' )
220
+ ds . get_filename ( 'some_file.txt ' )
223
221
pkg_dir = pjoin (tmpdir , 'pkg' )
224
222
os .mkdir (pkg_dir )
225
223
tmpfile = pjoin (pkg_dir , 'config.ini' )
@@ -235,4 +233,4 @@ def test_datasource_or_bomber(with_nimd_env):
235
233
pkg_def ['min version' ] = '0.3'
236
234
ds = datasource_or_bomber (pkg_def ) # not OK
237
235
with pytest .raises (DataError ):
238
- getattr ( ds , ' get_filename' )
236
+ ds . get_filename ( 'some_file.txt ' )
0 commit comments