Skip to content

Commit 84dee74

Browse files
committed
missed a test
1 parent fa4a368 commit 84dee74

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

test/cli/project_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def test_missing_project(project_ext):
2020
def __test_project_error(tmpdir, ext, content, expected):
2121
project_file = os.path.join(tmpdir, "file.{}".format(ext))
2222

23-
with open(project_file, 'w') as f:
23+
with open(project_file, 'wb') as f:
2424
if content is not None:
25-
f.write(content)
25+
f.write(content.encode('utf-8'))
2626

2727
ret, stdout, stderr = cppcheck(['--project=' + str(project_file)])
2828
assert 1 == ret
@@ -102,7 +102,7 @@ def test_sln_invalid_file(tmpdir):
102102

103103

104104
def test_sln_no_header(tmpdir):
105-
content = "\xEF\xBB\xBF\r\n" \
105+
content = "\r\n" \
106106
"some header"
107107

108108
expected = "Visual Studio solution file header not found"
@@ -111,7 +111,7 @@ def test_sln_no_header(tmpdir):
111111

112112

113113
def test_sln_no_projects(tmpdir):
114-
content = "\xEF\xBB\xBF\r\n" \
114+
content = "\r\n" \
115115
"Microsoft Visual Studio Solution File, Format Version 12.00\r\n"
116116

117117
expected = "no projects found in Visual Studio solution file"
@@ -120,7 +120,7 @@ def test_sln_no_projects(tmpdir):
120120

121121

122122
def test_sln_project_file_not_found(tmpdir):
123-
content = "\xEF\xBB\xBF\r\n" \
123+
content = "\r\n" \
124124
"Microsoft Visual Studio Solution File, Format Version 12.00\r\n" \
125125
"# Visual Studio Version 16\r\n" \
126126
"VisualStudioVersion = 16.0.29020.237\r\n" \

0 commit comments

Comments
 (0)