From 2ee423017bb444e1370b50862340559012bda739 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Tue, 20 Aug 2019 19:01:39 -0600 Subject: [PATCH 1/2] Skip some non-Windows tests on Windows Some tests will never pass on Windows due to differences in filesystems between Windows and Linux. --- RELEASE.md | 4 ++++ pelican/tests/test_contents.py | 9 +++++---- pelican/tests/test_generators.py | 19 ++++++++++++++++--- pelican/tests/test_utils.py | 6 ++++++ 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 000000000..521973a93 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,4 @@ +Release type: patch + +Skip some tests (on Windows) that are un-able to pass on Windows due to the +difference in Windows vs Linux filesystems. diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 104bc8890..efc438c89 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -14,9 +14,10 @@ from pelican.contents import Article, Author, Category, Page, Static from pelican.settings import DEFAULT_CONFIG from pelican.signals import content_object_init -from pelican.tests.support import LoggedTestCase, get_context, get_settings,\ - unittest -from pelican.utils import SafeDatetime, path_to_url, truncate_html_words +from pelican.tests.support import (LoggedTestCase, get_context, get_settings, + unittest) +from pelican.utils import (SafeDatetime, path_to_url, posixize_path, + truncate_html_words) # generate one paragraph, enclosed with

@@ -943,7 +944,7 @@ def test_not_save_as_draft(self): source_path=os.path.join('dir', 'foo.jpg'), context=self.settings.copy()) - expected_save_as = os.path.join('dir', 'foo.jpg') + expected_save_as = posixize_path(os.path.join('dir', 'foo.jpg')) self.assertEqual(static.status, 'draft') self.assertEqual(static.save_as, expected_save_as) self.assertEqual(static.url, path_to_url(expected_save_as)) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 267571da0..2455d1f44 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -1089,7 +1089,12 @@ def test_can_symlink_when_hardlink_not_possible(self): os.mkdir(os.path.join(self.temp_output, "static")) self.generator.fallback_to_symlinks = True self.generator.generate_context() - self.generator.generate_output(None) + try: + self.generator.generate_output(None) + except OSError as e: + # On Windows, possibly others, due to not holding symbolic link + # privilege + self.skipTest(e) self.assertTrue(os.path.islink(self.endfile)) def test_existing_symlink_is_considered_up_to_date(self): @@ -1097,7 +1102,11 @@ def test_existing_symlink_is_considered_up_to_date(self): with open(self.startfile, "w") as f: f.write("staticcontent") os.mkdir(os.path.join(self.temp_output, "static")) - os.symlink(self.startfile, self.endfile) + try: + os.symlink(self.startfile, self.endfile) + except OSError as e: + # On Windows, possibly others + self.skipTest(e) staticfile = MagicMock() staticfile.source_path = self.startfile staticfile.save_as = self.endfile @@ -1109,7 +1118,11 @@ def test_invalid_symlink_is_overwritten(self): with open(self.startfile, "w") as f: f.write("staticcontent") os.mkdir(os.path.join(self.temp_output, "static")) - os.symlink("invalid", self.endfile) + try: + os.symlink("invalid", self.endfile) + except OSError as e: + # On Windows, possibly others + self.skipTest(e) staticfile = MagicMock() staticfile.source_path = self.startfile staticfile.save_as = self.endfile diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 2831eeed2..444190d3f 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -717,6 +717,8 @@ def test_turkish_locale(self): class TestSanitisedJoin(unittest.TestCase): + @unittest.skipIf(platform == 'win32', + "Different filesystem root on Windows") def test_detect_parent_breakout(self): with six.assertRaisesRegex( self, @@ -727,6 +729,8 @@ def test_detect_parent_breakout(self): "../test" ) + @unittest.skipIf(platform == 'win32', + "Different filesystem root on Windows") def test_detect_root_breakout(self): with six.assertRaisesRegex( self, @@ -737,6 +741,8 @@ def test_detect_root_breakout(self): "/test" ) + @unittest.skipIf(platform == 'win32', + "Different filesystem root on Windows") def test_pass_deep_subpaths(self): self.assertEqual( utils.sanitised_join( From f9975ed47e8af49e723aa0c4cde50686e127292a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 9 Oct 2019 11:28:53 -0700 Subject: [PATCH 2/2] Update RELEASE.md --- RELEASE.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 521973a93..02c403319 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,9 @@ Release type: patch -Skip some tests (on Windows) that are un-able to pass on Windows due to the -difference in Windows vs Linux filesystems. +* Fix quick-start docs regarding `pelican --listen` +* Set default listen address to 127.0.0.1 +* Add extra/optional Markdown dependency to setup.py +* Use correct SSH port syntax for rsync in tasks.py +* Place all deprecated settings handling together +* Add related project URLs for display on PyPI +* Skip some tests on Windows that can't pass due to filesystem differences