From 727af5ecab47d4e24d27ef01ee492f7dbc63481b Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Fri, 15 Feb 2013 20:39:20 +0100 Subject: [PATCH] Limit number of tests for Travis CI. --- tests/test_comics.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_comics.py b/tests/test_comics.py index 7b07994ad..6c7dcd90c 100644 --- a/tests/test_comics.py +++ b/tests/test_comics.py @@ -89,13 +89,13 @@ def make_comic_tester(name, **kwargs): def generate_comic_testers(): """For each comic scraper, create a test class.""" g = globals() - # optional: limit number of scraper tests - max_scrapers = 0 - if max_scrapers: - scrapers = islice(scraper.get_scraperclasses(), 0, max_scrapers) + if "TRAVIS" in os.environ: + # get limited number of scraper tests on Travis builds + max_scrapers = 20 + scraperclasses = islice(scraper.get_scraperclasses(), 0, max_scrapers) else: - scrapers = scraper.get_scraperclasses() - for scraperclass in scrapers: + scraperclasses = scraper.get_scraperclasses() + for scraperclass in scraperclasses: name = 'Test'+scraperclass.__name__ g[name] = make_comic_tester(name, scraperclass=scraperclass)