Coverage for scrapy/utils/test : 71%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
""" This module contains some assorted functions used in tests """
"""Decorator for debugging libxml2 memory leaks inside a function.
We've found libxml2 memory leaks are something very weird, and can happen sometimes depending on the order where tests are run. So this decorator enables libxml2 memory leaks debugging only when the environment variable LIBXML2_DEBUGLEAKS is set.
""" except ImportError: return testfunction libxml2.debugMemory(1) testfunction(*args, **kwargs) libxml2.cleanupParser() leaked_bytes = libxml2.debugMemory(0) assert leaked_bytes == 0, "libxml2 memory leak detected: %d bytes" % leaked_bytes
return newfunc else:
"""Asserts the current environment is suitable for running AWS testsi. Raises SkipTest with the reason if it's not. """ except ImportError, e: raise SkipTest(str(e))
"""Return an unconfigured Crawler object. If settings_dict is given, it will be used as the settings present in the settings module of the CrawlerSettings. """ |