Add option to skip test if site returns error status (e.g. timeout connecting with site). This makes it easier to interpret the test results.

This commit is contained in:
Christopher K. Hoadley 2020-01-02 06:03:41 -06:00
parent 2c9fb4f295
commit de0ccfebb7

View file

@ -53,6 +53,7 @@ class SherlockBaseTest(unittest.TestCase):
self.tor=False
self.unique_tor=False
self.timeout=None
self.skip_error_sites=True
return
@ -123,6 +124,16 @@ class SherlockBaseTest(unittest.TestCase):
with self.subTest(f"Checking Username '{username}' "
f"{check_type_text} on Site '{site}'"
):
if (
(self.skip_error_sites == True) and
(result['status'].status == QueryStatus.UNKNOWN)
):
#Some error connecting to site.
self.skipTest(f"Skipping Username '{username}' "
f"{check_type_text} on Site '{site}': "
f"Site returned error status."
)
self.assertEqual(result['status'].status,
exist_result_desired)