Skip to content

Commit

Permalink
Merge pull request pytroll#22 from pytroll/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
pkhalaj authored Dec 5, 2024
2 parents 793c55d + 13f1b35 commit ad0dcb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fail_fast: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.7.4'
rev: 'v0.8.1'
hooks:
- id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
4 changes: 2 additions & 2 deletions trolldb/errors/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
specifically. See :obj:`trolldb.database.errors` as an example on how to achieve this.
"""

import sys
from collections import OrderedDict
from sys import exit
from typing import ClassVar, NoReturn, Self

from fastapi import Response
Expand Down Expand Up @@ -226,7 +226,7 @@ def sys_exit_log(
"""
_, msg = self.get_error_details(extra_information, status_code)
logger.error(msg)
exit(exit_code)
sys.exit(exit_code)

@property
def fastapi_descriptor(self) -> dict[StatusCode, dict[str, str]]:
Expand Down
4 changes: 2 additions & 2 deletions trolldb/tests/tests_database/test_mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import pytest
from bson import ObjectId
from pydantic import AnyUrl, ValidationError
from pydantic import MongoDsn, ValidationError

from trolldb.database.errors import Client, Collections, Databases
from trolldb.database.mongodb import DatabaseConfig, MongoDB, get_id, get_ids, mongodb_context
Expand All @@ -23,7 +23,7 @@
async def test_connection_timeout_negative(check_log):
"""Tests that the connection attempt times out after the expected time, since the MongoDB URL is invalid."""
invalid_config = DatabaseConfig(
url=AnyUrl("mongodb://invalid_url_that_does_not_exist:8000"),
url=MongoDsn("mongodb://invalid_url_that_does_not_exist:8000"),
timeout=3,
main_database_name=test_app_config.database.main_database_name,
main_collection_name=test_app_config.database.main_collection_name,
Expand Down

0 comments on commit ad0dcb2

Please sign in to comment.