mirror of https://github.com/fail2ban/fail2ban
TST: Skip badips.py test is no network option set
parent
75325da090
commit
175c593462
|
@ -209,6 +209,9 @@ def gatherTests(regexps=None, no_network=False):
|
||||||
for file_ in os.listdir(
|
for file_ in os.listdir(
|
||||||
os.path.abspath(os.path.dirname(action_d.__file__))):
|
os.path.abspath(os.path.dirname(action_d.__file__))):
|
||||||
if file_.startswith("test_") and file_.endswith(".py"):
|
if file_.startswith("test_") and file_.endswith(".py"):
|
||||||
|
if no_network and file_ in ['test_badips.py']: #pragma: no cover
|
||||||
|
# Test required network
|
||||||
|
continue
|
||||||
tests.addTest(testloader.loadTestsFromName(
|
tests.addTest(testloader.loadTestsFromName(
|
||||||
"%s.%s" % (action_d.__name__, os.path.splitext(file_)[0])))
|
"%s.%s" % (action_d.__name__, os.path.splitext(file_)[0])))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue