mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Add tests.running_in_ci()
This commit is contained in:
parent
e23ca84177
commit
6d14986bd6
2 changed files with 7 additions and 3 deletions
|
|
@ -38,6 +38,11 @@ class TestBase(unittest.TestCase):
|
|||
init_i18n()
|
||||
|
||||
|
||||
@lru_cache(1)
|
||||
def running_in_ci():
|
||||
return "CI" in os.environ
|
||||
|
||||
|
||||
def run(cmd, verbosity=0, **kwargs):
|
||||
"""Run command without error checking.
|
||||
@return: command return code"""
|
||||
|
|
|
|||
|
|
@ -16,15 +16,14 @@
|
|||
"""
|
||||
Test http stuff with httpbin.org.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
from tests import need_network
|
||||
from tests import need_network, running_in_ci
|
||||
from . import LinkCheckTest
|
||||
|
||||
|
||||
def get_httpbin_url(path):
|
||||
"""Get httpbin URL."""
|
||||
if "CI" in os.environ:
|
||||
if running_in_ci():
|
||||
host = "localhost:8080"
|
||||
else:
|
||||
host = "httpbin.org"
|
||||
|
|
|
|||
Loading…
Reference in a new issue