Simplify telethon unit tests for CI (don't use TestExtractorBase - it causes loading issues)

This commit is contained in:
Patrick Robertson
2025-03-26 23:51:21 +04:00
parent e0e9f93065
commit b7949a489f
2 changed files with 17 additions and 29 deletions

View File

@@ -2,6 +2,7 @@ import os
import shutil
import re
import time
from pathlib import Path
from datetime import date
from telethon.sync import TelegramClient
@@ -42,8 +43,7 @@ class TelethonExtractor(Extractor):
logger.warning(
f"SETUP - Session file {base_session_filepath} does not exist for {self.name}, creating an empty one."
)
with open(base_session_filepath, "w") as f:
f.write("")
Path(base_session_filepath).touch()
# make a copy of the session that is used exclusively with this archiver instance
self.session_file = os.path.join(