From 0ff6af1b99d4a9a79a9cf2877952a66b6493f872 Mon Sep 17 00:00:00 2001 From: Jimmy Situ Date: Tue, 20 Aug 2024 21:37:57 +0800 Subject: [PATCH] Update test for tempfile using --- tests/test_stocks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_stocks.py b/tests/test_stocks.py index 0dc25d3..be7432a 100755 --- a/tests/test_stocks.py +++ b/tests/test_stocks.py @@ -1,5 +1,6 @@ #!/usr/bin/python3 -u +import tempfile import sqlite3 from msfinance import stocks import os @@ -12,7 +13,7 @@ def test_stocks(): proxy = 'socks5://127.0.0.1:1088' - session='/tmp/msfinance/msf.db3' + session = os.path.join(tempfile.gettempdir(), 'msfinance', 'msf.db3') if 'true' == os.getenv('GITHUB_ACTIONS'): @@ -37,7 +38,7 @@ def test_stocks(): sp500_tickers = stock.get_sp500_tickers() assert 'AAPL' in sp500_tickers - + hsi_tickers = stock.get_hsi_tickers() assert '00700' in hsi_tickers