Skip to content

Fix test failures on windows #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Feb 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use context manager
  • Loading branch information
studyingegret committed Feb 6, 2025
commit ad8e7bb2a383df2f9a72416471ea08a16dc41fe1
6 changes: 3 additions & 3 deletions fluent.runtime/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ def patch_me(a, b):
def assertFileIs(self, filename, expect_contents):
"""
expect_contents is None: Expect file does not exist
expect_contents is a str: Expect file contents to match
expect_contents is a str: Expect file to exist and contents to match
"""
if expect_contents is None:
self.assertFalse(os.path.isfile(filename),
f"Expected {filename} to not exist.")
else:
self.assertTrue(os.path.isfile(filename),
f"Expected {filename} to exist.")
self.assertEqual(codecs.open(filename, "r", "utf-8").read(),
expect_contents)
with codecs.open(filename, "r", "utf-8") as f:
self.assertEqual(f.read(), expect_contents)
Loading