Skip to content

Commit 37988a2

Browse files
committed
Add simple verbosity test
1 parent 3a6237e commit 37988a2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_main.py

+20
Original file line numberDiff line numberDiff line change
@@ -447,3 +447,23 @@ def raise_called_process_err(*args, **kwargs):
447447
< stderror
448448
"""
449449
)
450+
451+
452+
@pytest.mark.parametrize('verbosity', [0, 1])
453+
def test_verbose_output(
454+
capsys: pytest.CaptureFixture,
455+
monkeypatch,
456+
tmp_dir,
457+
package_test_flit,
458+
verbosity: int,
459+
):
460+
monkeypatch.setenv('NO_COLOR', '')
461+
462+
cmd = [package_test_flit, '-w', '-o', tmp_dir]
463+
if verbosity:
464+
cmd.insert(0, f'-{"v" * verbosity}')
465+
466+
build.__main__.main(cmd)
467+
468+
stdout = capsys.readouterr().out.splitlines()
469+
assert sum(1 for o in stdout if o.startswith('> ')) == verbosity

0 commit comments

Comments
 (0)