MCPcopy
hub / github.com/scrapy/scrapy / test_profiling

Method test_profiling

tests/test_cmdline/__init__.py:37–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 )
36
37 def test_profiling(self):
38 path = Path(tempfile.mkdtemp())
39 filename = path / "res.prof"
40 try:
41 self._execute("version", "--profile", str(filename))
42 assert filename.exists()
43 out = StringIO()
44 stats = pstats.Stats(str(filename), stream=out)
45 stats.print_stats()
46 out.seek(0)
47 stats = out.read()
48 assert str(Path("scrapy", "commands", "version.py")) in stats
49 assert "tottime" in stats
50 finally:
51 shutil.rmtree(path)
52
53 def test_override_dict_settings(self):
54 EXT_PATH = "tests.test_cmdline.extensions.DummyExtension"

Callers

nothing calls this directly

Calls 2

_executeMethod · 0.95
readMethod · 0.80

Tested by

no test coverage detected