Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask2agent.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/ephys-link.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/ephys_link/front_end/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from os import makedirs
from os.path import exists, join
from socket import gethostbyname, gethostname
from sys import exit
from sys import exit as sys_exit
from tkinter import CENTER, RIGHT, BooleanVar, E, IntVar, StringVar, Tk, ttk
from typing import final

Expand Down Expand Up @@ -73,7 +73,7 @@ def get_options(self) -> EphysLinkOptions:

# Exit if the user did not submit options.
if not self._submit:
exit(1)
sys_exit(1)

# Extract options from GUI.
options = EphysLinkOptions(
Expand Down
6 changes: 4 additions & 2 deletions src/ephys_link/utils/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from pkgutil import iter_modules

from packaging.version import parse
from requests import ConnectionError, ConnectTimeout, get
from requests import ConnectionError as RequestsConnectionError
from requests import ConnectTimeout as RequestsConnectTimeout
from requests import get
from vbl_aquarium.models.ephys_link import EphysLinkOptions

from ephys_link.__about__ import __version__
Expand Down Expand Up @@ -45,7 +47,7 @@ def check_for_updates(console: Console) -> None:
if parse(latest_version) > parse(__version__):
console.critical_print(f"Update available: {latest_version} (current: {__version__})")
console.critical_print("Download at: https://github.com/VirtualBrainLab/ephys-link/releases/latest")
except (ConnectionError, ConnectTimeout):
except (RequestsConnectionError, RequestsConnectTimeout):
console.error_print("UPDATE", UNABLE_TO_CHECK_FOR_UPDATES_ERROR)


Expand Down
7 changes: 4 additions & 3 deletions tests/utils/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

import pytest
from pytest_mock import MockerFixture
from requests import ConnectionError, ConnectTimeout
from requests import ConnectionError as RequestsConnectionError
from requests import ConnectTimeout as RequestsConnectTimeout
from vbl_aquarium.models.ephys_link import EphysLinkOptions

from ephys_link.__about__ import __version__
Expand Down Expand Up @@ -76,9 +77,9 @@ def test_check_for_updates_is_older(self, console: Console, mocker: MockerFixtur
# Assert: critical_print should be called since an update is available.
spied_critical_print.assert_called()

@pytest.mark.parametrize("exception", [ConnectionError, ConnectTimeout])
@pytest.mark.parametrize("exception", [RequestsConnectionError, RequestsConnectTimeout])
def test_check_for_updates_connection_errors(
self, exception: ConnectionError | ConnectTimeout, console: Console, mocker: MockerFixture
self, exception: RequestsConnectionError | RequestsConnectTimeout, console: Console, mocker: MockerFixture
) -> None:
"""Test the check_for_updates function with connection-related errors."""
# Add mocks and spies.
Expand Down