Add tests.running_in_ci()

This commit is contained in:
Chris Mayo 2024-08-27 19:34:28 +01:00
parent e23ca84177
commit 6d14986bd6
2 changed files with 7 additions and 3 deletions

View file

@ -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"""

View file

@ -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"