Skip to content

Commit d010a05

Browse files
committed
chore: autoformat tests
1 parent 7b541ff commit d010a05

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

tests/data/test_trade_converter_kraken.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ def test_import_kraken_trades_from_csv(testdatadir, tmp_path, caplog, default_co
4949
trades = dh.trades_load("BCH_EUR", TradingMode.SPOT)
5050
assert len(trades) == 340
5151

52-
assert trades["date"].min().to_pydatetime() == datetime(
53-
2023, 1, 1, 0, 3, 56, tzinfo=UTC
54-
)
55-
assert trades["date"].max().to_pydatetime() == datetime(
56-
2023, 1, 2, 23, 17, 3, tzinfo=UTC
57-
)
52+
assert trades["date"].min().to_pydatetime() == datetime(2023, 1, 1, 0, 3, 56, tzinfo=UTC)
53+
assert trades["date"].max().to_pydatetime() == datetime(2023, 1, 2, 23, 17, 3, tzinfo=UTC)
5854
# ID is not filled
5955
assert len(trades.loc[trades["id"] != ""]) == 0
6056

tests/exchange/test_okx.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ def test_okx_ohlcv_candle_limit(default_conf, mocker):
2929
assert exchange.ohlcv_candle_limit(timeframe, CandleType.FUNDING_RATE, start_time) == 100
3030
one_call = int(
3131
(
32-
datetime.now(UTC)
33-
- timedelta(minutes=290 * timeframe_to_minutes(timeframe))
32+
datetime.now(UTC) - timedelta(minutes=290 * timeframe_to_minutes(timeframe))
3433
).timestamp()
3534
* 1000
3635
)
@@ -40,8 +39,7 @@ def test_okx_ohlcv_candle_limit(default_conf, mocker):
4039

4140
one_call = int(
4241
(
43-
datetime.now(UTC)
44-
- timedelta(minutes=320 * timeframe_to_minutes(timeframe))
42+
datetime.now(UTC) - timedelta(minutes=320 * timeframe_to_minutes(timeframe))
4543
).timestamp()
4644
* 1000
4745
)

tests/util/test_datetime_helpers.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,14 @@ def test_dt_ts_none():
5050

5151
def test_dt_utc():
5252
assert dt_utc(2023, 5, 5) == datetime(2023, 5, 5, tzinfo=UTC)
53-
assert dt_utc(2023, 5, 5, 0, 0, 0, 555500) == datetime(
54-
2023, 5, 5, 0, 0, 0, 555500, tzinfo=UTC
55-
)
53+
assert dt_utc(2023, 5, 5, 0, 0, 0, 555500) == datetime(2023, 5, 5, 0, 0, 0, 555500, tzinfo=UTC)
5654

5755

5856
@pytest.mark.parametrize("as_ms", [True, False])
5957
def test_dt_from_ts(as_ms):
6058
multi = 1000 if as_ms else 1
6159
assert dt_from_ts(1683244800.0 * multi) == datetime(2023, 5, 5, tzinfo=UTC)
62-
assert dt_from_ts(1683244800.5555 * multi) == datetime(
63-
2023, 5, 5, 0, 0, 0, 555500, tzinfo=UTC
64-
)
60+
assert dt_from_ts(1683244800.5555 * multi) == datetime(2023, 5, 5, 0, 0, 0, 555500, tzinfo=UTC)
6561
# As int
6662
assert dt_from_ts(1683244800 * multi) == datetime(2023, 5, 5, tzinfo=UTC)
6763
# As milliseconds

0 commit comments

Comments
 (0)