diff --git a/tests/fixtures.py b/tests/fixtures.py index 6077be6..359cd03 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -6,7 +6,6 @@ (see LICENSE for details). """ -import joblib import numpy as np import os import pandas as pd @@ -51,8 +50,8 @@ def predict(self, _): @pytest.fixture() def data_source_df(): - return joblib.load( - os.path.join(os.path.dirname(__file__), "testdata/daily_1.joblib") + return pd.read_pickle( + os.path.join(os.path.dirname(__file__), "testdata/daily_1.pkl") ) diff --git a/tests/test_data.py b/tests/test_data.py index f0c02b8..bb38514 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -7,7 +7,6 @@ """ import akshare -import joblib import os import pandas as pd import pytest @@ -48,8 +47,8 @@ @pytest.fixture() def alpaca_df(): - df = joblib.load( - os.path.join(os.path.dirname(__file__), "testdata/daily_1.joblib") + df = pd.read_pickle( + os.path.join(os.path.dirname(__file__), "testdata/daily_1.pkl") ) df["date"] = df["date"].dt.tz_localize("US/Eastern") return df.assign(vwap=1)[ALPACA_COLS] @@ -57,8 +56,8 @@ def alpaca_df(): @pytest.fixture() def alpaca_crypto_df(): - df = joblib.load( - os.path.join(os.path.dirname(__file__), "testdata/daily_1.joblib") + df = pd.read_pickle( + os.path.join(os.path.dirname(__file__), "testdata/daily_1.pkl") ) df["date"] = df["date"].dt.tz_localize("US/Eastern") return df.assign(vwap=1, trade_count=1)[ALPACA_CRYPTO_COLS] @@ -76,17 +75,15 @@ def crypto_bars_df(alpaca_crypto_df): @pytest.fixture() def yfinance_df(): - return joblib.load( - os.path.join(os.path.dirname(__file__), "testdata/yfinance.joblib") + return pd.read_pickle( + os.path.join(os.path.dirname(__file__), "testdata/yfinance.pkl") ) @pytest.fixture() def yfinance_single_df(): - return joblib.load( - os.path.join( - os.path.dirname(__file__), "testdata/yfinance_single.joblib" - ) + return pd.read_pickle( + os.path.join(os.path.dirname(__file__), "testdata/yfinance_single.pkl") ) diff --git a/tests/test_eval.py b/tests/test_eval.py index b76a74f..ee7f8aa 100644 --- a/tests/test_eval.py +++ b/tests/test_eval.py @@ -6,7 +6,6 @@ (see LICENSE for details). """ -import joblib import math import numpy as np import os @@ -68,15 +67,15 @@ def calc_bootstrap(request): @pytest.fixture() def portfolio_df(): - return joblib.load( - os.path.join(os.path.dirname(__file__), "testdata/portfolio_df.joblib") + return pd.read_pickle( + os.path.join(os.path.dirname(__file__), "testdata/portfolio_df.pkl") ) @pytest.fixture() def trades_df(): - return joblib.load( - os.path.join(os.path.dirname(__file__), "testdata/trades_df.joblib") + return pd.read_pickle( + os.path.join(os.path.dirname(__file__), "testdata/trades_df.pkl") ) diff --git a/tests/test_strategy.py b/tests/test_strategy.py index fa40ec7..ed6df16 100644 --- a/tests/test_strategy.py +++ b/tests/test_strategy.py @@ -6,7 +6,6 @@ (see LICENSE for details). """ -import joblib import numpy as np import os import pandas as pd @@ -1129,8 +1128,8 @@ class FakeDataSource(DataSource): def _fetch_data( self, symbols, start_date, end_date, timeframe, adjustment ): - return joblib.load( - os.path.join(os.path.dirname(__file__), "testdata/daily_1.joblib") + return pd.read_pickle( + os.path.join(os.path.dirname(__file__), "testdata/daily_1.pkl") ) diff --git a/tests/testdata/daily_1.joblib b/tests/testdata/daily_1.pkl similarity index 97% rename from tests/testdata/daily_1.joblib rename to tests/testdata/daily_1.pkl index a09b346..d4b8333 100644 Binary files a/tests/testdata/daily_1.joblib and b/tests/testdata/daily_1.pkl differ diff --git a/tests/testdata/portfolio_df.joblib b/tests/testdata/portfolio_df.pkl similarity index 97% rename from tests/testdata/portfolio_df.joblib rename to tests/testdata/portfolio_df.pkl index 0f37f4d..e803fed 100644 Binary files a/tests/testdata/portfolio_df.joblib and b/tests/testdata/portfolio_df.pkl differ diff --git a/tests/testdata/trades_df.joblib b/tests/testdata/trades_df.pkl similarity index 85% rename from tests/testdata/trades_df.joblib rename to tests/testdata/trades_df.pkl index 66cf992..6a571b9 100644 Binary files a/tests/testdata/trades_df.joblib and b/tests/testdata/trades_df.pkl differ diff --git a/tests/testdata/yfinance.joblib b/tests/testdata/yfinance.pkl similarity index 90% rename from tests/testdata/yfinance.joblib rename to tests/testdata/yfinance.pkl index 9698b13..ab713a7 100644 Binary files a/tests/testdata/yfinance.joblib and b/tests/testdata/yfinance.pkl differ diff --git a/tests/testdata/yfinance_single.joblib b/tests/testdata/yfinance_single.pkl similarity index 93% rename from tests/testdata/yfinance_single.joblib rename to tests/testdata/yfinance_single.pkl index c09bbbc..df82960 100644 Binary files a/tests/testdata/yfinance_single.joblib and b/tests/testdata/yfinance_single.pkl differ