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