Skip to content

Commit

Permalink
read_yaml test update
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKalema committed May 28, 2024
1 parent 84dd3e0 commit 760a0e7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import logging
import pytest

# Log Pytest Output
@pytest.fixture(scope="session", autouse=True)
def setup_logging(request):

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('potholeClassifierLogger')

def pytest_runtest_logreport(report):
if report.when == "call":
logger.info(report.nodeid + ": " + report.outcome.upper())
for line in report.caplog:
logger.info(line)

def teardown_logging():
logging.shutdown()

request.addfinalizer(teardown_logging)
3 changes: 2 additions & 1 deletion tests/test_common_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from box import ConfigBox
import io
import tempfile
import os


def test_read_yaml_valid_file() -> None:
Expand All @@ -19,7 +20,7 @@ def test_read_yaml_valid_file() -> None:
The function should return an object of type ConfigBox.
"""
result = read_yaml(CONFIG_FILE_PATH)
result = read_yaml(Path('../config/config.yaml'))
assert isinstance(result, ConfigBox)


Expand Down

0 comments on commit 760a0e7

Please sign in to comment.