Fall back to non-locked tests on systems without interprocess locking permission (eg. Travis).

This commit is contained in:
Bastian Kleineidam 2013-03-01 07:27:41 +01:00
parent 44679d8a7f
commit 6081021a24

View file

@ -54,7 +54,11 @@ class _ComicTester(TestCase):
scraperobj = self.scraperclass() scraperobj = self.scraperclass()
# Limit number of connections to one host. # Limit number of connections to one host.
host = get_host(scraperobj.url) host = get_host(scraperobj.url)
with get_lock(host): try:
with get_lock(host):
self._test_comic(scraperobj)
except OSError:
# interprocess lock not supported
self._test_comic(scraperobj) self._test_comic(scraperobj)
def _test_comic(self, scraperobj): def _test_comic(self, scraperobj):