File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,10 @@ def main():
36
36
except TemplateNotFound as e :
37
37
raise IndexGeneratorTemplateNotFound (str (e ))
38
38
except BaseException as e :
39
- print ('[Exception] ' + e .__class__ .__name__ + ': ' + str (e ))
40
- if hasattr (e , 'hint' ):
41
- print (e .hint )
39
+ if e .__class__ .__name__ != 'SystemExit' :
40
+ print ('[Exception] ' + e .__class__ .__name__ + ': ' + str (e ))
41
+ if hasattr (e , 'hint' ):
42
+ print (e .hint )
42
43
43
44
44
45
def app (args ):
Original file line number Diff line number Diff line change
1
+ import sys
2
+ from index_generator .__main__ import main
3
+ from index_generator import *
4
+
5
+
6
+ def test_app_version (capfd ):
7
+ sys .argv = ['index_generator' , '--version' ]
8
+ main ()
9
+ out , err = capfd .readouterr ()
10
+ assert out == APP_NAME + ' ' + APP_VERSION + ' ' + APP_URL + "\n "
11
+ sys .argv = ['index_generator' , '-V' ]
12
+ main ()
13
+ out , err = capfd .readouterr ()
14
+ assert out == APP_NAME + ' ' + APP_VERSION + ' ' + APP_URL + "\n "
You can’t perform that action at this time.
0 commit comments