From f022c1c0b53b117b5772dacb0b4379cba56f8943 Mon Sep 17 00:00:00 2001 From: JohnserfSeed Date: Tue, 10 Dec 2024 20:42:55 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E8=B7=B3=E8=BF=87test=5Ftiktok=5Fcrawl?= =?UTF-8?q?er=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- f2/apps/tiktok/test/test_tiktok_crawler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/f2/apps/tiktok/test/test_tiktok_crawler.py b/f2/apps/tiktok/test/test_tiktok_crawler.py index 77e5660e..91980e8a 100644 --- a/f2/apps/tiktok/test/test_tiktok_crawler.py +++ b/f2/apps/tiktok/test/test_tiktok_crawler.py @@ -1,16 +1,21 @@ +import os import pytest from f2.apps.tiktok.model import UserPost from f2.apps.tiktok.filter import UserPostFilter from f2.apps.tiktok.crawler import TiktokCrawler from f2.utils.conf_manager import TestConfigManager +# 检查环境变量是否设置为跳过测试 +skip_in_ci = os.getenv("SKIP_IN_CI", "false").lower() == "true" + @pytest.fixture def cookie_fixture(): return TestConfigManager.get_test_config("tiktok") -@pytest.mark.asyncio +# @pytest.mark.asyncio +@pytest.mark.skipif(skip_in_ci, reason="Skipping test in CI environment") async def test_crawler_by_secUid(cookie_fixture): async with TiktokCrawler(cookie_fixture) as crawler: params = UserPost(