From 9603bf5194f347ead6bfe1683b841a5459e7bf43 Mon Sep 17 00:00:00 2001 From: floriscalkoen Date: Thu, 31 Aug 2023 23:49:36 +0200 Subject: [PATCH] load catalog outside function for CI tests --- tests/test_all_collections_unique.py | 6 +++--- tests/test_validation.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_all_collections_unique.py b/tests/test_all_collections_unique.py index dbac888e60..d0e5708b18 100644 --- a/tests/test_all_collections_unique.py +++ b/tests/test_all_collections_unique.py @@ -1,10 +1,10 @@ from pystac import Catalog +href = "../current/catalog.json" +root = Catalog.from_file(href) -def test_all_collections_unique(): - href = "../current/catalog.json" - root = Catalog.from_file(href) +def test_all_collections_unique(): collections = root.get_all_collections() collection_ids = [collection.id for collection in collections] diff --git a/tests/test_validation.py b/tests/test_validation.py index 69a61d4c51..e62a5813f5 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -1,9 +1,10 @@ from pystac import Catalog +href = "../current/catalog.json" +root = Catalog.from_file(href) + def test_catalog_is_valid(): - href = "../current/catalog.json" - root = Catalog.from_file(href) # this will raise a Pystac exception if the catalog is not valid n_validated = ( root.validate_all()