Skip to content

Commit d8ce6ac

Browse files
committed
Fix: test.
1 parent fd35999 commit d8ce6ac

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_cmdcomp.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import re
2+
13
import pytest
24
from pytest import CaptureFixture
35

6+
from cmdcomp import __version__
47
from cmdcomp.app import App
58
from cmdcomp.shell import ShellType
69
from tests.conftest import SAMPLES_DIR
@@ -26,9 +29,10 @@ def test_application(
2629
]
2730
)
2831

29-
assert (
30-
capsys.readouterr().out
31-
== open(SAMPLES_DIR / version / f"output.{str(shell.value)}").read()
32+
assert capsys.readouterr().out == re.sub(
33+
r'\n# Code generated by cmdcomp ".*"\. DO NOT EDIT\.\n',
34+
f'\n# Code generated by cmdcomp "{__version__}". DO NOT EDIT.\n',
35+
open(SAMPLES_DIR / version / f"output.{str(shell.value)}").read(),
3236
)
3337

3438
def test_output_file_to_samples(

0 commit comments

Comments
 (0)