Commit 0b3af2dadd93bfa8cb21bd9ee14ca08481948e8c
1 parent
94f4566e
tests: handle unicode output in test bypassing main()
Showing
1 changed file
with
2 additions
and
0 deletions
tests/oleobj/test_basic.py
| @@ -10,6 +10,7 @@ from glob import glob | @@ -10,6 +10,7 @@ from glob import glob | ||
| 10 | # Directory with test data, independent of current working directory | 10 | # Directory with test data, independent of current working directory |
| 11 | from tests.test_utils import DATA_BASE_DIR, call_and_capture | 11 | from tests.test_utils import DATA_BASE_DIR, call_and_capture |
| 12 | from oletools import oleobj | 12 | from oletools import oleobj |
| 13 | +from oletools.common.io_encoding import ensure_stdout_handles_unicode | ||
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | #: provide some more info to find errors | 16 | #: provide some more info to find errors |
| @@ -61,6 +62,7 @@ def calc_md5(filename): | @@ -61,6 +62,7 @@ def calc_md5(filename): | ||
| 61 | 62 | ||
| 62 | def preread_file(args): | 63 | def preread_file(args): |
| 63 | """helper for TestOleObj.test_non_streamed: preread + call process_file""" | 64 | """helper for TestOleObj.test_non_streamed: preread + call process_file""" |
| 65 | + ensure_stdout_handles_unicode() # usually, main() call this | ||
| 64 | ignore_arg, output_dir, filename = args | 66 | ignore_arg, output_dir, filename = args |
| 65 | if ignore_arg != '-d': | 67 | if ignore_arg != '-d': |
| 66 | raise ValueError('ignore_arg not as expected!') | 68 | raise ValueError('ignore_arg not as expected!') |