File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 17
17
18
18
19
19
class TestLibFuturize (unittest .TestCase ):
20
+ def test_correct_exit_status (self ):
21
+ """
22
+ Issue #119: futurize and pasteurize were not exiting with the correct
23
+ status code. This is because the status code returned from
24
+ libfuturize.main.main() etc. was a ``newint``, which sys.exit() always
25
+ translates into 1!
26
+ """
27
+ from libfuturize .main import main
28
+ # Try futurizing this test script:
29
+ retcode = main ([__file__ ])
30
+ self .assertTrue (isinstance (retcode , int )) # i.e. Py2 builtin int
31
+
20
32
def test_is_shebang_comment (self ):
21
33
"""
22
34
Tests whether the fixer_util.is_encoding_comment() function is working.
Original file line number Diff line number Diff line change @@ -129,6 +129,18 @@ def test_urllib_refactor2(self):
129
129
filename = urllib_parse.urlparse(url)[2].split('/')[-1]
130
130
"""
131
131
132
+ def test_correct_exit_status (self ):
133
+ """
134
+ Issue #119: futurize and pasteurize were not exiting with the correct
135
+ status code. This is because the status code returned from
136
+ libfuturize.main.main() etc. was a ``newint``, which sys.exit() always
137
+ translates into 1!
138
+ """
139
+ from libpasteurize .main import main
140
+ # Try pasteurizing this test script:
141
+ retcode = main ([__file__ ])
142
+ self .assertTrue (isinstance (retcode , int )) # i.e. Py2 builtin int
143
+
132
144
133
145
class TestFuturizeAnnotations (CodeHandler ):
134
146
@unittest .expectedFailure
You can’t perform that action at this time.
0 commit comments