Skip to content

Commit 2005669

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1801451 commit 2005669

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

brainglobe_atlasapi/bg_atlas.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""Defines the BrainGlobeAtlas class for accessing brain atlas data."""
22

3+
import shutil
34
import tarfile
5+
import warnings
46
from collections.abc import Callable
57
from io import StringIO
68
from pathlib import Path
79
from typing import Optional, Tuple, Union
8-
import shutil
9-
import warnings
10+
1011
import requests
1112
from rich import print as rprint
1213
from rich.console import Console
@@ -118,7 +119,7 @@ def __init__(
118119

119120
if check_latest:
120121
self.check_latest_version()
121-
122+
122123
@property
123124
def local_version(self) -> Optional[Tuple[int, ...]]:
124125
"""If atlas is local, return actual version of the downloaded files;

tests/atlasapi/test_recovery.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from brainglobe_atlasapi.bg_atlas import BrainGlobeAtlas
22

3+
34
def test_recovers_missing_metadata(mocker):
45
"""
56
Test that BrainGlobeAtlas recovers from missing metadata by re-downloading.
67
"""
7-
88
# Mock Atlas.__init__: fail once, succeed second time
99
mock_atlas_init = mocker.patch(
1010
"brainglobe_atlasapi.core.Atlas.__init__",
@@ -27,15 +27,11 @@ def test_recovers_missing_metadata(mocker):
2727
"brainglobe_atlasapi.bg_atlas.BrainGlobeAtlas.check_latest_version"
2828
)
2929

30-
mock_rmtree = mocker.patch(
31-
"brainglobe_atlasapi.bg_atlas.shutil.rmtree"
32-
)
30+
mock_rmtree = mocker.patch("brainglobe_atlasapi.bg_atlas.shutil.rmtree")
3331

3432
# Act
3533
BrainGlobeAtlas("example_mouse_100um", check_latest=False)
3634

3735
# Assert
3836
assert mock_atlas_init.call_count == 2
3937
mock_download.assert_called_once()
40-
41-

0 commit comments

Comments
 (0)