From c702c5301523e57ce276d80c8106f9a52853948d Mon Sep 17 00:00:00 2001 From: palego Date: Sun, 3 Jan 2016 14:33:42 +0100 Subject: [PATCH 1/2] change os.mknod() for open() os.mknod() is a privileged command on OS X, making the test fail --- tests/test_commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_commands.py b/tests/test_commands.py index 5755b3881..8edccd4bd 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -83,7 +83,8 @@ class StartprojectTemplatesTest(ProjectTest): def test_startproject_template_override(self): copytree(join(scrapy.__path__[0], 'templates'), self.tmpl) - os.mknod(join(self.tmpl_proj, 'root_template')) + with open(join(self.tmpl_proj, 'root_template'), 'w'): + pass assert exists(join(self.tmpl_proj, 'root_template')) args = ['--set', 'TEMPLATES_DIR=%s' % self.tmpl] From 6b905a9aecb0e0e22339353a983257f3707d98b8 Mon Sep 17 00:00:00 2001 From: palego Date: Sat, 16 Jan 2016 14:23:58 +0100 Subject: [PATCH 2/2] split-up the assertIn to deal with OS X intricacies (directories prefixed with /private) --- tests/test_commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_commands.py b/tests/test_commands.py index 8edccd4bd..aa1b7cc7a 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -90,8 +90,8 @@ class StartprojectTemplatesTest(ProjectTest): args = ['--set', 'TEMPLATES_DIR=%s' % self.tmpl] p = self.proc('startproject', self.project_name, *args) out = to_native_str(retry_on_eintr(p.stdout.read)) - self.assertIn("New Scrapy project %r, using template directory %r, created in:" % \ - (self.project_name, join(self.tmpl, 'project')), out) + self.assertIn("New Scrapy project %r, using template directory" % self.project_name, out) + self.assertIn(self.tmpl_proj, out) assert exists(join(self.proj_path, 'root_template'))