| 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" |