File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -248,11 +248,11 @@ def process_args(args):
248
248
249
249
outdir = op .abspath (args .outdir )
250
250
251
- import etelemetry
252
251
try :
252
+ import etelemetry
253
253
latest = etelemetry .get_project ("nipy/heudiconv" )
254
254
except Exception as e :
255
- lgr .warning ("Could not check for version updates: " , e )
255
+ lgr .warning ("Could not check for version updates: %s " , str ( e ) )
256
256
latest = {"version" : 'Unknown' }
257
257
258
258
lgr .info (INIT_MSG (packname = __packagename__ ,
Original file line number Diff line number Diff line change 1
1
# TODO: break this up by modules
2
2
3
- from heudiconv .cli .run import main as runner
3
+ from heudiconv .cli .run import (
4
+ main as runner ,
5
+ process_args ,
6
+ )
4
7
from heudiconv import __version__
5
8
from heudiconv .utils import (create_file_if_missing ,
6
9
set_readonly ,
@@ -271,3 +274,16 @@ def test_cache(tmpdir):
271
274
assert (cachedir / 'dicominfo.tsv' ).exists ()
272
275
assert (cachedir / 'S01.auto.txt' ).exists ()
273
276
assert (cachedir / 'S01.edit.txt' ).exists ()
277
+
278
+
279
+ def test_no_etelemetry ():
280
+ # smoke test at large - just verifying that no crash if no etelemetry
281
+ class args :
282
+ outdir = '/dev/null'
283
+ command = 'ls'
284
+ heuristic = 'reproin'
285
+ files = [] # Nothing to list
286
+
287
+ # must not fail if etelemetry no found
288
+ with patch .dict ('sys.modules' , {'etelemetry' : None }):
289
+ process_args (args )
You can’t perform that action at this time.
0 commit comments