From 27c90f07a5e4b07ca744ae307a63d7f8cfac5eea Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Fri, 28 Jun 2013 21:25:55 +0200 Subject: [PATCH] Fix tests with newer pytest versions. --- tests/test_comics.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/test_comics.py b/tests/test_comics.py index 00737942e..4905b14d6 100644 --- a/tests/test_comics.py +++ b/tests/test_comics.py @@ -34,10 +34,11 @@ class _ComicTester(TestCase): scraperclass=None def setUp(self): - self.name = self.scraperclass.getName() - self.url = self.scraperclass.starter() - # create a temporary directory for images - self.tmpdir = tempfile.mkdtemp() + if self.scraperclass is not None: + self.name = self.scraperclass.getName() + self.url = self.scraperclass.starter() + # create a temporary directory for images + self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.tmpdir) @@ -48,6 +49,10 @@ class _ComicTester(TestCase): return os.listdir(os.path.join(self.tmpdir, *dirs)) def test_comic(self): + if self.scraperclass is None: + # only run subclasses + import pytest + pytest.skip("base class") # Test a scraper. It must be able to traverse backward for # at least 5 strips from the start, and find strip images # on at least 4 pages.