From ae6723be0c94e1e979523efbffa39cd0f422db41 Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Tue, 17 Apr 2018 00:29:39 -0400 Subject: Parameterize a couple unit tests --- tests/test_dotfile.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/test_dotfile.py b/tests/test_dotfile.py index 4d81c6c..9d04eed 100644 --- a/tests/test_dotfile.py +++ b/tests/test_dotfile.py @@ -11,15 +11,17 @@ def _dotfile(repo, name, target=None): repo.path.join(target if target is not None else name)) -def test_str(repo): - dotfile = _dotfile(repo, '.a', '.b') - assert str(dotfile) == repo.homedir.join('.a') +@pytest.mark.parametrize('name', ['.a']) +def test_str(repo, name): + dotfile = _dotfile(repo, name, '.b') + assert str(dotfile) == repo.homedir.join(name) -def test_short_name(repo): - dotfile = _dotfile(repo, '.foo') - assert dotfile.name == repo.homedir.join('.foo') - assert dotfile.short_name(repo.homedir) == '.foo' +@pytest.mark.parametrize('name', ['.foo']) +def test_short_name(repo, name): + dotfile = _dotfile(repo, name) + assert dotfile.name == repo.homedir.join(name) + assert dotfile.short_name(repo.homedir) == name def test_state_error(repo): -- cgit v1.2.3