/
githubmirror
/
scrapy
Обзор
Документация
Войти
/
githubmirror
/
scrapy
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/test_dependencies.py
31 строка
1010 B
Andrey Rakhmatullin
More granular untyped defs checking in tests. (#7712)
08 июл 2026, 11:05
Не верифицирован
08 июл 2026, 11:05
61f99f2
Код
Авторство
О чём код?
from __future__ import annotations import os import re from configparser import ConfigParser from pathlib import Path import pytest from twisted import version as twisted_version class TestScrapyUtils: def test_pinned_twisted_version(self): """When running tests within a Tox environment with pinned dependencies, make sure that the version of Twisted is the pinned version. See https://github.com/scrapy/scrapy/pull/4814#issuecomment-706230011 """ if not os.environ.get("_SCRAPY_MIN", None): pytest.skip("Not in a min environment") tox_config_file_path = Path(__file__).parent / ".." / "tox.ini" config_parser = ConfigParser() config_parser.read(tox_config_file_path) pattern = r"Twisted==([\d.]+)" match = re.search(pattern, config_parser["min"]["deps"]) assert match pinned_twisted_version_string = match[1] assert twisted_version.short() == pinned_twisted_version_string