Improve finding tests.test_cmdline.settings.

This commit is contained in:
Andrey Rakhmatullin 2023-06-12 21:50:29 +04:00
parent 49839d6071
commit 493ea43538
1 changed files with 3 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import json
import os
import pstats
import shutil
import sys
@ -14,6 +15,8 @@ from scrapy.utils.test import get_testenv
class CmdlineTest(unittest.TestCase):
def setUp(self):
self.env = get_testenv()
tests_path = Path(__file__).parent.parent
self.env["PYTHONPATH"] += os.pathsep + str(tests_path.parent)
self.env["SCRAPY_SETTINGS_MODULE"] = "tests.test_cmdline.settings"
def _execute(self, *new_args, **kwargs):