MCPcopy
hub / github.com/scrapy/scrapy / _execute

Method _execute

tests/test_cmdline/__init__.py:21–26  ·  view source on GitHub ↗
(self, *new_args, **kwargs)

Source from the content-addressed store, hash-verified

19 self.env["SCRAPY_SETTINGS_MODULE"] = "tests.test_cmdline.settings"
20
21 def _execute(self, *new_args, **kwargs):
22 encoding = sys.stdout.encoding or "utf-8"
23 args = (sys.executable, "-m", "scrapy.cmdline", *new_args)
24 proc = Popen(args, stdout=PIPE, stderr=PIPE, env=self.env, **kwargs)
25 comm = proc.communicate()[0].strip()
26 return comm.decode(encoding)
27
28 def test_default_settings(self):
29 assert self._execute("settings", "--get", "TEST1") == "default"

Calls

no outgoing calls