diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-01-23 16:55:35 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-01-24 04:01:36 +0530 |
commit | e2e80ff73f543c3f71e395b8d47a952f07c3f8a1 (patch) | |
tree | 8e9e0cf56302d81b60b5b800d4f8c2ce8c73bfbf | |
parent | ad3da4203d07ddc52944c10fa84bc88de25eedc5 (diff) | |
download | meson-e2e80ff73f543c3f71e395b8d47a952f07c3f8a1.zip meson-e2e80ff73f543c3f71e395b8d47a952f07c3f8a1.tar.gz meson-e2e80ff73f543c3f71e395b8d47a952f07c3f8a1.tar.bz2 |
unit tests: Open all documentation as utf-8
Fixes compatibility of unit tests with Python 3.5.2 on Ubuntu 16.04
-rwxr-xr-x | run_unittests.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/run_unittests.py b/run_unittests.py index c75f2cd..f1fdd1c 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1229,7 +1229,7 @@ class DataTests(unittest.TestCase): platform on the CI. ''' md = None - with open('docs/markdown/Builtin-options.md') as f: + with open('docs/markdown/Builtin-options.md', encoding='utf-8') as f: md = f.read() self.assertIsNotNone(md) env = get_fake_env() @@ -1249,7 +1249,7 @@ class DataTests(unittest.TestCase): Builtin-Options.md. ''' md = None - with open('docs/markdown/Builtin-options.md') as f: + with open('docs/markdown/Builtin-options.md', encoding='utf-8') as f: md = f.read() self.assertIsNotNone(md) @@ -1283,7 +1283,7 @@ class DataTests(unittest.TestCase): ])) def test_cpu_families_documented(self): - with open("docs/markdown/Reference-tables.md") as f: + with open("docs/markdown/Reference-tables.md", encoding='utf-8') as f: md = f.read() self.assertIsNotNone(md) @@ -1302,7 +1302,7 @@ class DataTests(unittest.TestCase): ''' Test that each markdown files in docs/markdown is referenced in sitemap.txt ''' - with open("docs/sitemap.txt") as f: + with open("docs/sitemap.txt", encoding='utf-8') as f: md = f.read() self.assertIsNotNone(md) toc = list(m.group(1) for m in re.finditer(r"^\s*(\w.*)$", md, re.MULTILINE)) @@ -5952,8 +5952,8 @@ c = ['{0}'] self._check_ld('ld.gold', 'gold', 'fortran', 'GNU ld.gold') def compute_sha256(self, filename): - with open(filename,"rb") as f: - return hashlib.sha256(f.read()).hexdigest(); + with open(filename, 'rb') as f: + return hashlib.sha256(f.read()).hexdigest() def test_wrap_with_file_url(self): testdir = os.path.join(self.unit_test_dir, '73 wrap file url') |