diff --git a/tests/test_converters/test_json.py b/tests/test_converters/test_json.py index 3cc5848..67ebb67 100644 --- a/tests/test_converters/test_json.py +++ b/tests/test_converters/test_json.py @@ -1,10 +1,9 @@ """Tests for JSON converter.""" -import pytest import json +import pytest import tempfile import os -from pathlib import Path from config_convert.converters import JSONConverter @@ -63,14 +62,13 @@ class TestJSONConverter: os.unlink(path) def test_dump_file(self, converter, temp_dir, sample_json): - import shutil path = tempfile.mktemp(suffix=".json") try: converter.dump(sample_json, path) - result = json.loads(Path(path).read_text()) + result = json.loads(open(path).read()) assert result == sample_json finally: - if Path(path).exists(): + if os.path.exists(path): os.unlink(path) def test_invalid_json_raises(self, converter):