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 1717
1818
1919class 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+
2032 def test_is_shebang_comment (self ):
2133 """
2234 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):
129129 filename = urllib_parse.urlparse(url)[2].split('/')[-1]
130130 """
131131
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+
132144
133145class TestFuturizeAnnotations (CodeHandler ):
134146 @unittest .expectedFailure
You can’t perform that action at this time.
0 commit comments