|
5 | 5 | from .test_extractor_base import TestExtractorBase |
6 | 6 |
|
7 | 7 |
|
| 8 | +CI = os.getenv("GITHUB_ACTIONS", "") == "true" |
| 9 | + |
| 10 | + |
8 | 11 | class DummySB: |
9 | 12 | def __init__(self, url="", title="", visible_texts=None, visible_elements=None): |
10 | 13 | self._url = url |
@@ -51,56 +54,67 @@ class TestAntibotExtractorEnricher(TestExtractorBase): |
51 | 54 |
|
52 | 55 | @pytest.mark.download |
53 | 56 | @pytest.mark.parametrize( |
54 | | - "url,in_title,in_text,image_count,video_count", |
| 57 | + "url,in_title,in_text,image_count,video_count,skip_ci", |
55 | 58 | [ |
56 | 59 | ( |
57 | 60 | "https://en.wikipedia.org/wiki/Western_barn_owl", |
58 | 61 | "western barn owl", |
59 | 62 | "Tyto alba", |
60 | 63 | 4, |
61 | 64 | 0, |
| 65 | + False, |
62 | 66 | ), |
63 | 67 | ( |
64 | 68 | "https://www.bellingcat.com/news/2025/04/29/open-sources-show-myanmar-junta-airstrike-damages-despite-post-earthquake-ceasefire/", |
65 | 69 | "open sources show myanmar", |
66 | 70 | "Bellingcat has geolocated", |
67 | 71 | 5, |
68 | 72 | 0, |
| 73 | + False, |
69 | 74 | ), |
70 | 75 | ( |
71 | 76 | "https://www.bellingcat.com/news/2025/03/27/gaza-israel-palestine-shot-killed-injured-destroyed-dangerous-drone-journalists-in-gaza/", |
72 | 77 | "shot from above", |
73 | 78 | "continued the work of Gazan journalists", |
74 | 79 | 5, |
75 | 80 | 1, |
| 81 | + False, |
76 | 82 | ), |
77 | 83 | ( |
78 | 84 | "https://www.bellingcat.com/about/general-information", |
79 | 85 | "general information", |
80 | 86 | "Stichting Bellingcat", |
81 | 87 | 0, # SVGs are ignored |
82 | 88 | 0, |
| 89 | + False, |
83 | 90 | ), |
84 | 91 | ( |
85 | 92 | "https://vk.com/wikipedia?from=search&w=wall-36156673_20451", |
86 | 93 | "Hounds of Love", |
87 | 94 | "16 сентября 1985 года лейблом EMI Records.", |
88 | 95 | 5, |
89 | 96 | 0, |
| 97 | + False, |
90 | 98 | ), |
91 | 99 | ( |
92 | 100 | "https://www.tiktok.com/@tracy_2424/photo/7418200173953830162", |
93 | 101 | "TikTok", |
94 | 102 | "Dito ko lang", |
95 | 103 | 1, |
96 | 104 | 0, |
| 105 | + True, |
97 | 106 | ), |
98 | 107 | ], |
99 | 108 | ) |
100 | | - def test_download_pages_with_media(self, setup_module, make_item, url, in_title, in_text, image_count, video_count): |
| 109 | + def test_download_pages_with_media( |
| 110 | + self, setup_module, make_item, url, in_title, in_text, image_count, video_count, skip_ci |
| 111 | + ): |
101 | 112 | """ |
102 | 113 | Test downloading pages with media. |
103 | 114 | """ |
| 115 | + if CI and skip_ci: |
| 116 | + pytest.skip("Skipping test in CI environment") |
| 117 | + |
104 | 118 | self.extractor = setup_module( |
105 | 119 | self.extractor_module, |
106 | 120 | self.config |
|
0 commit comments