Skip to content

Commit

Permalink
remove tests on lock files as they are removed on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Nov 19, 2024
1 parent 0c4b4bf commit 60342e9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tests/matrixstore/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def test_save(self, tmp_path: str, matrix_format: str) -> None:
# then a file is created in the repo directory
matrix_file = bucket_dir.joinpath(f"{matrix_hash}.{matrix_format}")
assert matrix_file.exists()
assert bucket_dir.joinpath(f"{matrix_hash}.tsv.lock").exists()
array = matrix_format.load_matrix(matrix_file)
assert array.tolist() == data
modif_time = matrix_file.stat().st_mtime
Expand Down Expand Up @@ -304,8 +303,6 @@ def test_mixed_formats(self, tmp_path: str, matrix_format: str) -> None:
associated_hash = "d73f023a3f852bf2e5c6d836cd36cd930d0091dcba7f778161c707e1c58222b0"
matrix_path = matrix_content_repo.bucket_dir.joinpath(f"{associated_hash}.{saved_format}")
saved_format.save_matrix(df, matrix_path)
lock_path = matrix_path.with_suffix(".tsv.lock")
lock_path.touch()

# asserts the saved matrix object exists
assert matrix_content_repo.exists(associated_hash)
Expand All @@ -323,13 +320,11 @@ def test_mixed_formats(self, tmp_path: str, matrix_format: str) -> None:

# Recreates the matrix
saved_format.save_matrix(df, matrix_path)
lock_path.touch()
# saving the same matrix will migrate its format to the repository one.
matrix_content_repo.save(data)
assert lock_path.exists()
saved_matrix_files = list(matrix_content_repo.bucket_dir.glob(f"*.{matrix_format}"))
assert not saved_matrix_files
repo_matrix_files = list(matrix_content_repo.bucket_dir.glob(f"*.{repository_format}"))
assert len(repo_matrix_files) == 1
new_matrix_path = matrix_content_repo.bucket_dir.with_suffix(f".{repository_format}")
new_matrix_path = matrix_path.with_suffix(f".{repository_format}")
assert repo_matrix_files[0] == new_matrix_path

0 comments on commit 60342e9

Please sign in to comment.