-
Notifications
You must be signed in to change notification settings - Fork 87
🐛 FIX: cli.parse: return 0 for non-error #53 #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 FIX: cli.parse: return 0 for non-error #53 #55
Conversation
2578c9c to
386be1c
Compare
Codecov Report
@@ Coverage Diff @@
## master #55 +/- ##
==========================================
+ Coverage 95.40% 95.43% +0.02%
==========================================
Files 75 73 -2
Lines 3745 3567 -178
==========================================
- Hits 3573 3404 -169
+ Misses 172 163 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
386be1c to
1a27821
Compare
1a27821 to
1d71c4c
Compare
Co-authored-by: Taneli Hukkinen <hukkinj1@users.noreply.github.com>
| def test_parse_fail(): | ||
| with pytest.raises(SystemExit) as exc_info: | ||
| parse.main(["/tmp/nonexistant_path/for_cli_test.md"]) | ||
| assert exc_info.value.code == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to fix the test failure is:
| assert exc_info.value.code == 1 | |
| assert isinstance(exc_info.value.code, str) |
Another way, that I personally would prefer but don't know if @chrisjsewell would, is go to markdown_it.cli.parse.convert_file and replace
sys.exit('Cannot open file "{}".'.format(filename))with
sys.stderr.write('Cannot open file "{}".\n'.format(filename))
sys.exit(1)|
Superseded by #124 |
|
Thanks |
This is necessary so that make doesn't fail to execute this task due to
markdown-itreturning True (1) instead of zero (0) for success: