Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
4 changes: 3 additions & 1 deletion webknossos/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def proxay(mode: Literal["record", "replay"], quiet: bool) -> Iterator[None]:
def run_pytest(args: list[str]) -> None:
process = subprocess.Popen(args)
try:
process.wait()
exit_code = process.wait()
except KeyboardInterrupt:
print("Terminating pytest", flush=True)
if IS_WINDOWS:
Expand All @@ -224,6 +224,8 @@ def run_pytest(args: list[str]) -> None:
process.send_signal(signal.SIGINT)
process.wait()
raise
if exit_code != 0:
raise ValueError("pytest failed")


def main(snapshot_command: Literal["refresh", "add"] | None, args: list[str]) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dataLayers": [
{
"name": "tiff",
"category": "segmentation",
"category": "color",
"boundingBox": {
"topLeft": [0, 0, 0],
"width": 265,
Expand All @@ -32,8 +32,7 @@
"path": "./tiff/1"
}
],
"numChannels": 1,
"largestSegmentId": 255
"numChannels": 1
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_remote_dataset(tmp_upath: UPath) -> None:
)

assert not remote_ds.read_only
assert not remote_ds.get_color_layers()[0].read_only
assert remote_ds.get_color_layers()[0].read_only
assert remote_ds.get_color_layers()[0].get_finest_mag().read_only

assert remote_ds.name == "test_remote_metadata"
Expand Down
2 changes: 1 addition & 1 deletion webknossos/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def test_export_tiff_stack_tiles_per_dimension(tmp_upath: UPath) -> None:
for x_tile_index in range(ceil(tile_bbox.size.x / tile_bbox.size.x)):
tiff_path = (
destination_path
/ f"{data_slice_index + 1}"
/ f"{data_slice_index}"
/ f"{y_tile_index + 1}"
/ f"{x_tile_index + 1}.tiff"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ def from_path_and_name(
path,
)

def __eq__(self, other: object) -> bool:
if not isinstance(other, Attachment):
return False
return (
self.name == other.name
and self.path == other.path
and self.data_format == other.data_format
)

def __repr__(self) -> str:
return f"{self.__class__.__name__}(path={repr(self.path)}, name={self.name}, data_format={self.data_format})"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,8 @@ def _remove_attachment(
raise KeyError(
f"Attachment {attachment} is not part of {container_name}."
)
setattr(self, container_name, None)
setattr(self._properties, container_name, None)
else:
setattr(
self,
container_name,
tuple(p for p in getattr(self, container_name) if p != attachment),
)
properties_container = getattr(self._properties, container_name)
properties_container.remove(attachment._properties)
if len(properties_container) == 0:
Expand Down
Loading