From 369e2237caa8ddf4f30d6a362da00f62d7d5a906 Mon Sep 17 00:00:00 2001 From: Lars Falk-Petersen Date: Wed, 20 Nov 2024 14:40:14 +0100 Subject: [PATCH] Remove default url --- sedr/__init__.py | 1 - sedr/schemat.py | 5 ++--- sedr/test_schemat.py | 1 + sedr/util.py | 5 ++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sedr/__init__.py b/sedr/__init__.py index 81381dc..5a63eb1 100644 --- a/sedr/__init__.py +++ b/sedr/__init__.py @@ -12,7 +12,6 @@ def main() -> None: # show-capture=no means hide stdout/stderr. Should change debug output instead. pytest.main(["-rA", "--show-capture=no", "./sedr/schemat.py"]) - # pytest.main(["-rA", "./sedr/schemat.py"]) # Handle --version and --help diff --git a/sedr/schemat.py b/sedr/schemat.py index 0ca0bb6..8c0ad12 100644 --- a/sedr/schemat.py +++ b/sedr/schemat.py @@ -42,11 +42,10 @@ def set_up_schemathesis(args) -> BaseOpenAPISchema: util.logger.info("Using EDR version %s", edreq.__edr_version__) if args.openapi.startswith("http"): + util.logger.info("Testing site %s using OpenAPI spec <%s>", args.url, args.openapi) return schemathesis.from_uri(uri=args.openapi, base_url=args.url) - util.logger.info( - "openapi <%s> doesn't seem to be a URL, opening as path.", util.args.openapi - ) + util.logger.info("Testing site %s using local OpenAPI spec at path <%s>", args.url, args.openapi) return schemathesis.from_path(path=util.args.openapi, base_url=args.url) diff --git a/sedr/test_schemat.py b/sedr/test_schemat.py index de3282c..f75099b 100644 --- a/sedr/test_schemat.py +++ b/sedr/test_schemat.py @@ -2,6 +2,7 @@ import unittest import util +import pytest class TestInit(unittest.TestCase): diff --git a/sedr/util.py b/sedr/util.py index 9a6cc2a..62b9b0b 100644 --- a/sedr/util.py +++ b/sedr/util.py @@ -10,8 +10,7 @@ __author__ = "Lars Falk-Petersen" __license__ = "GPL-3.0" -args = None -logger = logging.getLogger(__file__) +args = logger = None def parse_args(args, version: str = "") -> argparse.Namespace: @@ -25,7 +24,7 @@ def parse_args(args, version: str = "") -> argparse.Namespace: default="", ) parser.add_argument( - "--url", type=str, help="URL to API", default="https://edrisobaric.k8s.met.no" + "--url", type=str, help="URL to API", default="" ) parser.add_argument( "--iterations",