mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-11-04 01:47:27 +03:00 
			
		
		
		
	Mark tests requiring network access
This commit is contained in:
		
							parent
							
								
									f69e309b0b
								
							
						
					
					
						commit
						cc65ee473e
					
				
							
								
								
									
										2
									
								
								check.sh
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								check.sh
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
isort . --profile black --gitignore
 | 
			
		||||
black . --extend-exclude "tl/(abcs|functions|types)/\w+.py"
 | 
			
		||||
mypy --strict .
 | 
			
		||||
pytest .
 | 
			
		||||
pytest . -m "not net"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
import os
 | 
			
		||||
import random
 | 
			
		||||
from pytest import mark
 | 
			
		||||
 | 
			
		||||
from telethon._impl.client.client.client import Client
 | 
			
		||||
from telethon._impl.client.client.net import Config
 | 
			
		||||
| 
						 | 
				
			
			@ -7,6 +8,8 @@ from telethon._impl.session.message_box.defs import Session
 | 
			
		|||
from telethon._impl.tl.mtproto import functions, types
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@mark.api
 | 
			
		||||
@mark.net
 | 
			
		||||
async def test_ping_pong() -> None:
 | 
			
		||||
    api_id = os.getenv("TG_ID")
 | 
			
		||||
    api_hash = os.getenv("TG_HASH")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
import asyncio
 | 
			
		||||
import logging
 | 
			
		||||
 | 
			
		||||
from pytest import LogCaptureFixture
 | 
			
		||||
from pytest import LogCaptureFixture, mark
 | 
			
		||||
from telethon._impl.mtproto.transport.full import Full
 | 
			
		||||
from telethon._impl.mtsender.sender import connect
 | 
			
		||||
from telethon._impl.tl import LAYER, abcs, functions, types
 | 
			
		||||
| 
						 | 
				
			
			@ -13,6 +13,7 @@ TELEGRAM_DEFAULT_TEST_DC = TELEGRAM_TEST_DC_2
 | 
			
		|||
TEST_TIMEOUT = 10000
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@mark.net
 | 
			
		||||
async def test_invoke_encrypted_method(caplog: LogCaptureFixture) -> None:
 | 
			
		||||
    caplog.set_level(logging.DEBUG)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,2 +1,5 @@
 | 
			
		|||
[pytest]
 | 
			
		||||
markers =
 | 
			
		||||
    net: performs network access
 | 
			
		||||
    api: requires TG_ID and TG_HASH environment variables
 | 
			
		||||
asyncio_mode = auto
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user