Ignore MangaDex in tests for now
This commit is contained in:
parent
2c8bb90d4e
commit
6d15be8b2c
1 changed files with 8 additions and 6 deletions
|
@ -13,11 +13,12 @@ from dosagelib.scraper import scrapers
|
||||||
|
|
||||||
def get_test_scrapers():
|
def get_test_scrapers():
|
||||||
"""Return scrapers that should be tested."""
|
"""Return scrapers that should be tested."""
|
||||||
if "TESTALL" in os.environ:
|
if 'TESTALL' in os.environ:
|
||||||
# test all comics (this will take some time)
|
# test all comics (this will take some time)
|
||||||
return scrapers.get()
|
# ignore mangadex for now (site is temporary down)
|
||||||
if 'TESTCOMICS' in os.environ:
|
scraper_pattern = '^(?!MangaDex)'
|
||||||
scraper_pattern = re.compile(os.environ['TESTCOMICS'])
|
elif 'TESTCOMICS' in os.environ:
|
||||||
|
scraper_pattern = os.environ['TESTCOMICS']
|
||||||
else:
|
else:
|
||||||
# Get limited number of scraper tests as default
|
# Get limited number of scraper tests as default
|
||||||
testscrapernames = [
|
testscrapernames = [
|
||||||
|
@ -28,11 +29,12 @@ def get_test_scrapers():
|
||||||
# _WordPressScraper
|
# _WordPressScraper
|
||||||
'GrrlPower',
|
'GrrlPower',
|
||||||
]
|
]
|
||||||
scraper_pattern = re.compile('^(' + '|'.join(testscrapernames) + ')$')
|
scraper_pattern = '^(' + '|'.join(testscrapernames) + ')$'
|
||||||
|
|
||||||
|
matcher = re.compile(scraper_pattern)
|
||||||
return [
|
return [
|
||||||
scraperobj for scraperobj in scrapers.get()
|
scraperobj for scraperobj in scrapers.get()
|
||||||
if scraper_pattern.match(scraperobj.name)
|
if matcher.match(scraperobj.name)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue