Skip to content

Commit ccb77da

Browse files
committed
black,isort,pylint 2
1 parent 18088f8 commit ccb77da

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

sarc/allocations/allocations.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class Allocation(BaseModel):
4949
end: Annotated[date, BeforeValidator(validate_date)]
5050
resources: AllocationRessources
5151

52-
@field_serializer('start', 'end')
52+
# pylint: disable=unused-argument
53+
@field_serializer("start", "end")
5354
def save_as_datetime(self, value, info):
5455
return datetime(year=value.year, month=value.month, day=value.day)
5556

sarc/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from datetime import date, datetime
88
from functools import cached_property
99
from pathlib import Path
10-
from typing import Annotated, Any, Dict, Optional, Union
10+
from typing import Annotated, Dict, Optional, Union
1111

1212
import pydantic
1313
import tzlocal

tests/functional/conftest.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
import json
44
from pathlib import Path
55

6+
import freezegun
67
import pytest
78
from _pytest.monkeypatch import MonkeyPatch
8-
9-
import freezegun
109
from pytest_regressions.data_regression import RegressionYamlDumper
1110

1211
from sarc.config import using_config
@@ -16,15 +15,19 @@
1615
from .diskusage.factory import create_diskusages
1716
from .jobs.factory import create_cluster_entries, create_jobs, create_users
1817

19-
2018
# this is to make the pytest-freezegun types serializable by pyyaml
2119
# (for use in pytest-regression)
2220

21+
2322
def repr_fakedatetime(dumper, data):
24-
value = data.isoformat(' ')
25-
return dumper.represent_scalar('tag:yaml.org,2002:timestamp', value)
23+
value = data.isoformat(" ")
24+
return dumper.represent_scalar("tag:yaml.org,2002:timestamp", value)
25+
26+
27+
RegressionYamlDumper.add_custom_yaml_representer(
28+
freezegun.api.FakeDatetime, repr_fakedatetime
29+
)
2630

27-
RegressionYamlDumper.add_custom_yaml_representer(freezegun.api.FakeDatetime, repr_fakedatetime)
2831

2932
@pytest.fixture
3033
def db_allocations():

0 commit comments

Comments
 (0)