MCPcopy
hub / github.com/scrapy/scrapy / test_pinned_twisted_version

Method test_pinned_twisted_version

tests/test_dependencies.py:11–28  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

9
10class TestScrapyUtils:
11 def test_pinned_twisted_version(self):
12 """When running tests within a Tox environment with pinned
13 dependencies, make sure that the version of Twisted is the pinned
14 version.
15
16 See https://github.com/scrapy/scrapy/pull/4814#issuecomment-706230011
17 """
18 if not os.environ.get("_SCRAPY_PINNED", None):
19 pytest.skip("Not in a pinned environment")
20
21 tox_config_file_path = Path(__file__).parent / ".." / "tox.ini"
22 config_parser = ConfigParser()
23 config_parser.read(tox_config_file_path)
24 pattern = r"Twisted==([\d.]+)"
25 match = re.search(pattern, config_parser["pinned"]["deps"])
26 pinned_twisted_version_string = match[1]
27
28 assert twisted_version.short() == pinned_twisted_version_string

Callers

nothing calls this directly

Calls 2

readMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected