diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 35223ee..f74121f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -23,5 +23,7 @@ jobs: pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Run tests with pytest + env: + COOKIE: ${{ secrets.COOKIE }} run: | pytest \ No newline at end of file diff --git a/api_test.py b/api_test.py index fc1e7ee..fd266dd 100644 --- a/api_test.py +++ b/api_test.py @@ -2,9 +2,7 @@ from pytest_html import extras import json import os from pprint import pprint -import dotenv from package.NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list -dotenv.load_dotenv() # 从.env文件中加载环境变量 netease_cloud_music_api = NeteaseCloudMusicApi() # 初始化API netease_cloud_music_api.cookie = os.getenv('COOKIE') # 设置cookie netease_cloud_music_api.DEBUG = True # 开启调试模式