Skip to content

Commit 60b7fac

Browse files
authored
fix unit test
1 parent 4d0ab69 commit 60b7fac

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/test_builds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,4 +705,4 @@ def test_ignored_commits(tmp_path):
705705

706706
page_with_tag = testproject_path / "site/page_with_tag/index.html"
707707
contents = page_with_tag.read_text(encoding="utf8")
708-
assert "May 4, 2018" in contents
708+
assert "May 4, 2018" in contents

tests/test_parse_git_ignore_revs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import tempfile
44

55
TEST_PARAMS = [
6-
(b"abc123\n", ["abc123"]),
7-
(b"abc123 # comments are ignored\n", ["abc123"]),
8-
(b"\n\n\n\n\nabc123\n\n\n\n\n", ["abc123"]),
6+
("abc123\n", ["abc123"]),
7+
("abc123 # comments are ignored\n", ["abc123"]),
8+
("\n\n\n\n\nabc123\n\n\n\n\n", ["abc123"]),
99
]
1010

1111
@pytest.mark.parametrize("test_input,expected", TEST_PARAMS)
1212
def test_parse_git_ignore_revs(test_input, expected):
13-
with tempfile.NamedTemporaryFile() as fp:
13+
with tempfile.NamedTemporaryFile(mode='w', encoding='utf-8') as fp:
1414
fp.write(test_input)
1515
fp.flush()
1616
assert Util.parse_git_ignore_revs(fp.name) == expected

0 commit comments

Comments
 (0)