aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-01-23 16:55:35 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-01-24 02:53:34 +0530
commit4d93a1142749e86bc09764cef7f591776d3b523e (patch)
tree78f6d9058d4f6aaa003a543f47c0f49bcd8fd615 /run_unittests.py
parent7672cd99c2f39ff612983a9d3f94b68a47aa22ce (diff)
downloadmeson-4d93a1142749e86bc09764cef7f591776d3b523e.zip
meson-4d93a1142749e86bc09764cef7f591776d3b523e.tar.gz
meson-4d93a1142749e86bc09764cef7f591776d3b523e.tar.bz2
unit tests: Open all documentation as utf-8
Fixes compatibility of unit tests with Python 3.5.2 on Ubuntu 16.04
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 3455dc7..d6d5208 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1231,7 +1231,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()
@@ -1251,7 +1251,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)
@@ -1285,7 +1285,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)
@@ -1304,7 +1304,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))
@@ -5982,8 +5982,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')