From 41cf8eaa768f41e988ddd693688fc9d795d58cf6 Mon Sep 17 00:00:00 2001 From: Ryan Avery Date: Sun, 25 Feb 2024 20:01:10 -0800 Subject: [PATCH] simplify test --- tests/test_schema.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/test_schema.py b/tests/test_schema.py index 4e2d387..8259cb0 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -1,5 +1,3 @@ -import os -import tempfile import pytest @@ -12,11 +10,5 @@ def metadata_json(): def test_model_metadata_json_operations(metadata_json): from stac_model.schema import MLModel - with tempfile.TemporaryDirectory() as temp_dir: - temp_filepath = os.path.join(temp_dir, "tempfile.json") - with open(temp_filepath, "w") as file: - file.write(metadata_json) - with open(temp_filepath) as json_file: - json_str = json_file.read() - model_metadata = MLModel.model_validate_json(json_str) + model_metadata = MLModel.model_validate_json(metadata_json) assert model_metadata.name == "Resnet-18 Sentinel-2 ALL MOCO"