-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update python-m2r to rev 4 via SR 756648
https://build.opensuse.org/request/show/756648 by user dimstar_suse - Instead of skipping the tests, the patch open-encoding.patch fixes gh#miyakogi/m2r#52.
- Loading branch information
1 parent
c2a70b5
commit 5e2e75a
Showing
5 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- a/tests/test_cli.py | ||
+++ b/tests/test_cli.py | ||
@@ -4,6 +4,7 @@ | ||
from __future__ import print_function, unicode_literals | ||
|
||
import sys | ||
+import io | ||
import os | ||
from os import path | ||
from copy import copy | ||
@@ -37,12 +38,12 @@ class TestConvert(TestCase): | ||
options.disable_inline_math = False | ||
self._orig_argv = copy(sys.argv) | ||
if path.exists(test_rst): | ||
- with open(test_rst) as f: | ||
+ with io.open(test_rst, encoding="utf8") as f: | ||
self._orig_rst = f.read() | ||
|
||
def tearDown(self): | ||
sys.argv = self._orig_argv | ||
- with open(test_rst, 'w') as f: | ||
+ with io.open(test_rst, 'w', encoding="utf8") as f: | ||
f.write(self._orig_rst) | ||
|
||
def test_no_file(self): | ||
@@ -62,14 +63,14 @@ class TestConvert(TestCase): | ||
|
||
def test_parse_file(self): | ||
output = parse_from_file(test_md) | ||
- with open(test_rst) as f: | ||
+ with io.open(test_rst, encoding="utf8") as f: | ||
expected = f.read() | ||
self.assertEqual(output.strip(), expected.strip()) | ||
|
||
def test_dryrun(self): | ||
sys.argv = [sys.argv[0], '--dry-run', test_md] | ||
target_file = path.join(curdir, 'test.rst') | ||
- with open(target_file) as f: | ||
+ with io.open(target_file, encoding="utf8") as f: | ||
rst = f.read() | ||
os.remove(target_file) | ||
self.assertFalse(path.exists(target_file)) | ||
@@ -89,24 +90,24 @@ class TestConvert(TestCase): | ||
def test_overwrite_file(self): | ||
sys.argv = [sys.argv[0], test_md] | ||
target_file = path.join(curdir, 'test.rst') | ||
- with open(target_file, 'w') as f: | ||
+ with io.open(target_file, 'w', encoding="utf8") as f: | ||
f.write('test') | ||
- with open(target_file) as f: | ||
+ with io.open(target_file, encoding="utf8") as f: | ||
first_line = f.readline() | ||
self.assertIn('test', first_line) | ||
with patch(_builtin + '.input', return_value='y'): | ||
main() | ||
self.assertTrue(path.exists(target_file)) | ||
- with open(target_file) as f: | ||
+ with io.open(target_file, encoding="utf8") as f: | ||
first_line = f.readline() | ||
self.assertNotIn('test', first_line) | ||
|
||
def test_overwrite_option(self): | ||
sys.argv = [sys.argv[0], '--overwrite', test_md] | ||
target_file = path.join(curdir, 'test.rst') | ||
- with open(target_file, 'w') as f: | ||
+ with io.open(target_file, 'w', encoding="utf8") as f: | ||
f.write('test') | ||
- with open(target_file) as f: | ||
+ with io.open(target_file, encoding="utf8") as f: | ||
first_line = f.readline() | ||
self.assertIn('test', first_line) | ||
with patch(_builtin + '.input', return_value='y') as m_input: | ||
@@ -115,7 +116,7 @@ class TestConvert(TestCase): | ||
self.assertTrue(path.exists(target_file)) | ||
self.assertFalse(m_input.called) | ||
self.assertFalse(m_print.called) | ||
- with open(target_file) as f: | ||
+ with io.open(target_file, encoding="utf8") as f: | ||
first_line = f.readline() | ||
self.assertNotIn('test', first_line) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
------------------------------------------------------------------- | ||
Fri Dec 13 00:04:10 CET 2019 - Matej Cepl <[email protected]> | ||
|
||
- Instead of skipping the tests, the patch open-encoding.patch | ||
fixes gh#miyakogi/m2r#52. | ||
|
||
------------------------------------------------------------------- | ||
Tue Dec 10 21:41:04 CET 2019 - Matej Cepl <[email protected]> | ||
|
||
- On Leap 15 skip tests which are failing. gh#miyakogi/m2r#52 | ||
|
||
------------------------------------------------------------------- | ||
Tue Mar 26 12:54:38 UTC 2019 - [email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters