Skip to content

Commit

Permalink
Pytest fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ModernMAK committed Oct 19, 2023
1 parent 1605ce9 commit 13ee676
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Binary file modified tests/data/SampleSGA-v2-Oct-15-2023.sga
Binary file not shown.
15 changes: 11 additions & 4 deletions tests/issues/test_issue_40.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import io
import os.path
from collections import Sequence
from typing import Iterable
from contextlib import redirect_stderr

import pytest
Expand Down Expand Up @@ -52,10 +52,15 @@
f"error: argument config_file: The given path '{os.path.abspath(f'{__file__}/..')}' is not a file!",
),
]
_ARGS2 = [
([av.replace("\\", "/") for av in a], b.replace("\\", "/")) for (a, b) in _ARGS
]

_ = _ARGS2


@pytest.mark.parametrize(["args", "msg"], _ARGS)
def test_argparse_error(args: Sequence[str], msg: str):
@pytest.mark.parametrize(["args", "msg"], [*_ARGS, *_ARGS2])
def test_argparse_error(args: Iterable[str], msg: str):
from relic.core.cli import cli_root

with io.StringIO() as f:
Expand All @@ -64,5 +69,7 @@ def test_argparse_error(args: Sequence[str], msg: str):
assert status == 2
f.seek(0)
err = f.read()
print(err)

if msg not in err: # Dumb, but helps avoid blaot
print(err)
assert msg in err

0 comments on commit 13ee676

Please sign in to comment.