1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
diff --git a/tests/_files/test_animation.py b/tests/_files/test_animation.py
index 23ec3b50..a7230495 100644
--- a/tests/_files/test_animation.py
+++ b/tests/_files/test_animation.py
@@ -65,6 +65,7 @@ class TestAnimationBase:
class TestAnimationWithoutRequest(TestAnimationBase):
+ __test__ = False
def test_slot_behaviour(self, animation):
for attr in animation.__slots__:
assert getattr(animation, attr, "err") != "err", f"got extra slot '{attr}'"
diff --git a/tests/_files/test_audio.py b/tests/_files/test_audio.py
index 3ea394d0..6a7c47e4 100644
--- a/tests/_files/test_audio.py
+++ b/tests/_files/test_audio.py
@@ -66,6 +66,7 @@ class TestAudioBase:
class TestAudioWithoutRequest(TestAudioBase):
+ __test__ = False
def test_slot_behaviour(self, audio):
for attr in audio.__slots__:
assert getattr(audio, attr, "err") != "err", f"got extra slot '{attr}'"
@@ -196,6 +197,7 @@ class TestAudioWithoutRequest(TestAudioBase):
class TestAudioWithRequest(TestAudioBase):
+ __test__ = False
async def test_send_all_args(self, bot, chat_id, audio_file, thumb_file):
message = await bot.send_audio(
chat_id,
diff --git a/tests/_files/test_chatphoto.py b/tests/_files/test_chatphoto.py
index d09876e2..65c3e213 100644
--- a/tests/_files/test_chatphoto.py
+++ b/tests/_files/test_chatphoto.py
@@ -61,6 +61,7 @@ class TestChatPhotoBase:
class TestChatPhotoWithoutRequest(TestChatPhotoBase):
+ __test__ = False
def test_slot_behaviour(self, chat_photo):
for attr in chat_photo.__slots__:
assert getattr(chat_photo, attr, "err") != "err", f"got extra slot '{attr}'"
@@ -155,6 +156,7 @@ class TestChatPhotoWithoutRequest(TestChatPhotoBase):
class TestChatPhotoWithRequest:
+ __test__ = False
async def test_get_and_download(self, bot, chat_photo, tmp_file):
tasks = {bot.get_file(chat_photo.small_file_id), bot.get_file(chat_photo.big_file_id)}
asserts = []
diff --git a/tests/_files/test_document.py b/tests/_files/test_document.py
index f5ccdbeb..f22cef77 100644
--- a/tests/_files/test_document.py
+++ b/tests/_files/test_document.py
@@ -61,6 +61,7 @@ class TestDocumentBase:
class TestDocumentWithoutRequest(TestDocumentBase):
+ __test__ = False
def test_slot_behaviour(self, document):
for attr in document.__slots__:
assert getattr(document, attr, "err") != "err", f"got extra slot '{attr}'"
@@ -190,6 +191,7 @@ class TestDocumentWithoutRequest(TestDocumentBase):
class TestDocumentWithRequest(TestDocumentBase):
+ __test__ = False
async def test_error_send_empty_file(self, bot, chat_id):
with Path(os.devnull).open("rb") as f, pytest.raises(TelegramError):
await bot.send_document(chat_id=chat_id, document=f)
diff --git a/tests/_files/test_inputmedia.py b/tests/_files/test_inputmedia.py
index f00dd165..bb4252f4 100644
--- a/tests/_files/test_inputmedia.py
+++ b/tests/_files/test_inputmedia.py
@@ -179,6 +179,7 @@ class TestInputMediaVideoWithoutRequest(TestInputMediaVideoBase):
assert input_media_video_dict["supports_streaming"] == input_media_video.supports_streaming
assert input_media_video_dict["has_spoiler"] == input_media_video.has_spoiler
+ @pytest.mark.skip(reason="Requires internet connection")
def test_with_video(self, video): # noqa: F811
# fixture found in test_video
input_media_video = InputMediaVideo(video, caption="test 3")
@@ -242,7 +243,8 @@ class TestInputMediaPhotoWithoutRequest(TestInputMediaPhotoBase):
ce.to_dict() for ce in input_media_photo.caption_entities
]
assert input_media_photo_dict["has_spoiler"] == input_media_photo.has_spoiler
-
+
+ @pytest.mark.skip(reason="Requires internet connection")
def test_with_photo(self, photo): # noqa: F811
# fixture found in test_photo
input_media_photo = InputMediaPhoto(photo, caption="test 2")
@@ -307,7 +309,8 @@ class TestInputMediaAnimationWithoutRequest(TestInputMediaAnimationBase):
assert input_media_animation_dict["height"] == input_media_animation.height
assert input_media_animation_dict["duration"] == input_media_animation.duration
assert input_media_animation_dict["has_spoiler"] == input_media_animation.has_spoiler
-
+
+ @pytest.mark.skip(reason="Requires internet connection")
def test_with_animation(self, animation): # noqa: F811
# fixture found in test_animation
input_media_animation = InputMediaAnimation(animation, caption="test 2")
@@ -375,7 +378,8 @@ class TestInputMediaAudioWithoutRequest(TestInputMediaAudioBase):
assert input_media_audio_dict["caption_entities"] == [
ce.to_dict() for ce in input_media_audio.caption_entities
]
-
+
+ @pytest.mark.skip(reason="Requires internet connection")
def test_with_audio(self, audio): # noqa: F811
# fixture found in test_audio
input_media_audio = InputMediaAudio(audio, caption="test 3")
@@ -447,6 +451,7 @@ class TestInputMediaDocumentWithoutRequest(TestInputMediaDocumentBase):
== input_media_document.disable_content_type_detection
)
+ @pytest.mark.skip(reason="Requires internet connection")
def test_with_document(self, document): # noqa: F811
# fixture found in test_document
input_media_document = InputMediaDocument(document, caption="test 3")
@@ -502,6 +507,7 @@ def media_group_no_caption_only_parse_mode(photo, thumb): # noqa: F811
class TestSendMediaGroupWithoutRequest:
+ @pytest.mark.skip(reason="Requires internet connection")
async def test_send_media_group_throws_error_with_group_caption_and_individual_captions(
self,
bot,
@@ -601,6 +607,7 @@ class CustomSequence(Sequence):
class TestSendMediaGroupWithRequest:
+ __test__ = False
async def test_send_media_group_photo(self, bot, chat_id, media_group):
messages = await bot.send_media_group(chat_id, media_group)
assert isinstance(messages, tuple)
diff --git a/tests/_files/test_photo.py b/tests/_files/test_photo.py
index 9f85bec5..263eb933 100644
--- a/tests/_files/test_photo.py
+++ b/tests/_files/test_photo.py
@@ -74,6 +74,7 @@ class TestPhotoBase:
class TestPhotoWithoutRequest(TestPhotoBase):
+ __test__ = False
def test_slot_behaviour(self, photo):
for attr in photo.__slots__:
assert getattr(photo, attr, "err") != "err", f"got extra slot '{attr}'"
@@ -211,6 +212,7 @@ class TestPhotoWithoutRequest(TestPhotoBase):
class TestPhotoWithRequest(TestPhotoBase):
+ __test__ = False
async def test_send_photo_all_args(self, bot, chat_id, photo_file):
message = await bot.send_photo(
chat_id,
diff --git a/tests/_files/test_sticker.py b/tests/_files/test_sticker.py
index c8b9b02a..8c8c9c56 100644
--- a/tests/_files/test_sticker.py
+++ b/tests/_files/test_sticker.py
@@ -115,6 +115,7 @@ class TestStickerBase:
class TestStickerWithoutRequest(TestStickerBase):
+ __test__ = False
def test_slot_behaviour(self, sticker):
for attr in sticker.__slots__:
assert getattr(sticker, attr, "err") != "err", f"got extra slot '{attr}'"
@@ -289,6 +290,7 @@ class TestStickerWithoutRequest(TestStickerBase):
class TestStickerWithRequest(TestStickerBase):
+ __test__ = False
async def test_send_all_args(self, bot, chat_id, sticker_file, sticker):
message = await bot.send_sticker(
chat_id, sticker=sticker_file, disable_notification=False, protect_content=True
@@ -526,6 +528,7 @@ class TestStickerSetBase:
class TestStickerSetWithoutRequest(TestStickerSetBase):
+ __test__ = False
def test_slot_behaviour(self):
inst = StickerSet("this", "is", True, self.stickers, True, "not")
for attr in inst.__slots__:
diff --git a/tests/_files/test_video.py b/tests/_files/test_video.py
index b2ec1098..d181ffa0 100644
--- a/tests/_files/test_video.py
+++ b/tests/_files/test_video.py
@@ -65,6 +65,7 @@ class TestVideoBase:
class TestVideoWithoutRequest(TestVideoBase):
+ __test__ = False
def test_slot_behaviour(self, video):
for attr in video.__slots__:
assert getattr(video, attr, "err") != "err", f"got extra slot '{attr}'"
@@ -203,6 +204,7 @@ class TestVideoWithoutRequest(TestVideoBase):
class TestVideoWithRequest(TestVideoBase):
+ __test__ = False
async def test_send_all_args(self, bot, chat_id, video_file, video, thumb_file):
message = await bot.send_video(
chat_id,
diff --git a/tests/_files/test_videonote.py b/tests/_files/test_videonote.py
index b931678d..223f2541 100644
--- a/tests/_files/test_videonote.py
+++ b/tests/_files/test_videonote.py
@@ -59,6 +59,7 @@ class TestVideoNoteBase:
class TestVideoNoteWithoutRequest(TestVideoNoteBase):
+ __test__ = False
def test_slot_behaviour(self, video_note):
for attr in video_note.__slots__:
assert getattr(video_note, attr, "err") != "err", f"got extra slot '{attr}'"
@@ -190,6 +191,7 @@ class TestVideoNoteWithoutRequest(TestVideoNoteBase):
class TestVideoNoteWithRequest(TestVideoNoteBase):
+ __test__ = False
async def test_send_all_args(self, bot, chat_id, video_note_file, video_note, thumb_file):
message = await bot.send_video_note(
chat_id,
diff --git a/tests/_files/test_voice.py b/tests/_files/test_voice.py
index b29260d5..14cdbba7 100644
--- a/tests/_files/test_voice.py
+++ b/tests/_files/test_voice.py
@@ -58,6 +58,7 @@ class TestVoiceBase:
class TestVoiceWithoutRequest(TestVoiceBase):
+ __test__ = False
def test_slot_behaviour(self, voice):
for attr in voice.__slots__:
assert getattr(voice, attr, "err") != "err", f"got extra slot '{attr}'"
@@ -177,6 +178,7 @@ class TestVoiceWithoutRequest(TestVoiceBase):
class TestVoiceWithRequest(TestVoiceBase):
+ __test__ = False
async def test_send_all_args(self, bot, chat_id, voice_file, voice):
message = await bot.send_voice(
chat_id,
diff --git a/tests/request/test_request.py b/tests/request/test_request.py
index 9334f7b7..fd3672b9 100644
--- a/tests/request/test_request.py
+++ b/tests/request/test_request.py
@@ -85,6 +85,7 @@ class TestNoSocksHTTP2WithoutRequest:
@pytest.mark.skipif(not TEST_WITH_OPT_DEPS, reason="Optional dependencies not installed")
class TestHTTP2WithRequest:
+ __test__ = False
@pytest.mark.parametrize("http_version", ["2", "2.0"])
async def test_http_2_response(self, http_version):
httpx_request = HTTPXRequest(http_version=http_version)
@@ -352,6 +353,7 @@ class TestRequestWithoutRequest:
@pytest.mark.skipif(not TEST_WITH_OPT_DEPS, reason="No need to run this twice")
class TestHTTPXRequestWithoutRequest:
+ __test__ = False
test_flag = None
@pytest.fixture(autouse=True)
@@ -621,6 +623,7 @@ class TestHTTPXRequestWithoutRequest:
@pytest.mark.skipif(not TEST_WITH_OPT_DEPS, reason="No need to run this twice")
class TestHTTPXRequestWithRequest:
+ __test__ = False
async def test_do_request_wait_for_pool(self, httpx_request):
"""The pool logic is buried rather deeply in httpxcore, so we make actual requests here
instead of mocking"""
diff --git a/tests/test_bot.py b/tests/test_bot.py
index d813d9f2..e580c68b 100644
--- a/tests/test_bot.py
+++ b/tests/test_bot.py
@@ -196,6 +196,7 @@ class InputMessageContentDWPP(InputMessageContent):
class TestBotWithoutRequest:
+ __test__ = False
"""
Most are executed on tg.ext.ExtBot, as that class only extends the functionality of tg.bot
@@ -1791,6 +1792,7 @@ class TestBotWithoutRequest:
class TestBotWithRequest:
+ __test__ = False
"""
Most are executed on tg.ext.ExtBot, as that class only extends the functionality of tg.bot
diff --git a/tests/test_forum.py b/tests/test_forum.py
index d367fc9c..17c5130a 100644
--- a/tests/test_forum.py
+++ b/tests/test_forum.py
@@ -74,6 +74,7 @@ async def real_topic(bot, emoji_id, forum_group_id):
class TestForumTopicWithoutRequest:
+ __test__ = False
def test_slot_behaviour(self, forum_topic_object):
inst = forum_topic_object
for attr in inst.__slots__:
@@ -154,6 +155,7 @@ class TestForumTopicWithoutRequest:
class TestForumMethodsWithRequest:
+ __test__ = False
async def test_create_forum_topic(self, real_topic):
result = real_topic
assert isinstance(result, ForumTopic)
@@ -349,7 +351,8 @@ class TestForumTopicCreatedWithoutRequest:
assert isinstance(action_dict, dict)
assert action_dict["name"] == TEST_TOPIC_NAME
assert action_dict["icon_color"] == TEST_TOPIC_ICON_COLOR
-
+
+ @pytest.mark.skip(reason="Requires internet connection")
def test_equality(self, emoji_id):
a = ForumTopicCreated(name=TEST_TOPIC_NAME, icon_color=TEST_TOPIC_ICON_COLOR)
b = ForumTopicCreated(
|