fix: resolve CI/CD test failures and linting issues
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import pytest
|
||||
import tempfile
|
||||
import os
|
||||
from pathlib import Path
|
||||
import yaml
|
||||
|
||||
from config_convert.converters import YAMLConverter
|
||||
|
||||
@@ -56,7 +56,6 @@ class TestYAMLConverter:
|
||||
assert loaded == original
|
||||
|
||||
def test_load_file(self, converter, temp_file, sample_yaml):
|
||||
import yaml
|
||||
gen = temp_file(sample_yaml, suffix=".yaml")
|
||||
path = next(gen)
|
||||
try:
|
||||
@@ -66,8 +65,6 @@ class TestYAMLConverter:
|
||||
os.unlink(path)
|
||||
|
||||
def test_dump_file(self, converter, temp_dir, sample_yaml):
|
||||
import yaml
|
||||
import shutil
|
||||
path = tempfile.mktemp(suffix=".yaml")
|
||||
try:
|
||||
data = yaml.safe_load(sample_yaml)
|
||||
@@ -75,7 +72,7 @@ class TestYAMLConverter:
|
||||
result = converter.load(path)
|
||||
assert result == data
|
||||
finally:
|
||||
if Path(path).exists():
|
||||
if os.path.exists(path):
|
||||
os.unlink(path)
|
||||
|
||||
def test_invalid_yaml_raises(self, converter):
|
||||
|
||||
Reference in New Issue
Block a user