Skip to content
Closed
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
73 changes: 29 additions & 44 deletions sdks/blue-krill/poetry.lock

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

2 changes: 1 addition & 1 deletion sdks/blue-krill/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ moto = "^2.3.2"
django-rest-framework = "^0.1.0"
celery = "^5.0.5"
# pytest
pytest = "^6.2.2"
pytest = ">=7,<8"
pytest-django = "^4.1.0"
# mypy
mypy = "^1.19.0"
Expand Down
14 changes: 8 additions & 6 deletions sdks/blue-krill/tests/storages/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.

import tempfile as _tempfile_
from tempfile import NamedTemporaryFile
from pathlib import Path
from typing import Callable, Generator, Optional

import pytest


@pytest.fixture
def mktemp() -> Generator[Callable[..., Path], None, None]:
files = []

def core(content: Optional[str] = None):
filepath = Path(_tempfile_.mktemp())
files.append(filepath)
if content:
with open(filepath, mode="w") as fh:
if content is not None:
with NamedTemporaryFile(mode="w", delete=False) as fh:
fh.write(content)
filepath = Path(fh.name)
else:
with NamedTemporaryFile(delete=False) as fh:
Comment on lines +30 to +34
filepath = Path(fh.name)
files.append(filepath)
return filepath

yield core
Expand Down