Skip to content

Commit

Permalink
Attempt to fix tests on Python 3.13 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Sep 9, 2024
1 parent 9f4f5b5 commit 159dea1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ def test_no_decode_encode(self):

tree = Tree()
latin1_name = "À".encode("latin1")
latin1_path = os.path.join(repo_dir_bytes, latin1_name)
try:
latin1_path = os.path.join(repo_dir_bytes, latin1_name)
except UnicodeDecodeError:
self.skipTest("can not decode as latin1")
utf8_name = "À".encode()
utf8_path = os.path.join(repo_dir_bytes, utf8_name)
tree[latin1_name] = (stat.S_IFREG | 0o644, file.id)
Expand Down
9 changes: 6 additions & 3 deletions tests/test_object_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,14 @@ def test_tempfile_in_loose_store(self):
def test_add_alternate_path(self):
store = DiskObjectStore(self.store_dir)
self.assertEqual([], list(store._read_alternate_paths()))
store.add_alternate_path("/foo/path")
self.assertEqual(["/foo/path"], list(store._read_alternate_paths()))
store.add_alternate_path(os.path.abspath("/foo/path"))
self.assertEqual(
[os.path.abspath("/foo/path")], list(store._read_alternate_paths())
)
store.add_alternate_path("/bar/path")
self.assertEqual(
["/foo/path", "/bar/path"], list(store._read_alternate_paths())
[os.path.abspath("/foo/path"), os.path.abspath("/bar/path")],
list(store._read_alternate_paths()),
)

def test_rel_alternative_path(self):
Expand Down

0 comments on commit 159dea1

Please sign in to comment.