diff options
author | Florian Bruhin <git@the-compiler.org> | 2017-05-23 08:08:46 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2017-05-23 08:08:46 +0200 |
commit | af7923de4dad6ee5b5ac40a123a1d3397a66aef6 (patch) | |
tree | 606ea55fd1e5445219f6e797982a75c73954bd52 /tests/unit/utils/test_utils.py | |
parent | 18a761369b796aefae63d0fd73c85045e10b3817 (diff) | |
download | qutebrowser-af7923de4dad6ee5b5ac40a123a1d3397a66aef6.tar.gz qutebrowser-af7923de4dad6ee5b5ac40a123a1d3397a66aef6.zip |
tests: Use pytest.param
Diffstat (limited to 'tests/unit/utils/test_utils.py')
-rw-r--r-- | tests/unit/utils/test_utils.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index 7eb4008a6..33e881c22 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -657,17 +657,19 @@ QUALNAME_OBJ = QualnameObj() @pytest.mark.parametrize('obj, expected', [ - (QUALNAME_OBJ, repr(QUALNAME_OBJ)), # instance - unknown - (QualnameObj, 'test_utils.QualnameObj'), # class - (QualnameObj.func, 'test_utils.QualnameObj.func'), # unbound method - (QualnameObj().func, 'test_utils.QualnameObj.func'), # bound method - (qualname_func, 'test_utils.qualname_func'), # function - (functools.partial(qualname_func, True), 'test_utils.qualname_func'), - (qutebrowser, 'qutebrowser'), # module - (qutebrowser.utils, 'qutebrowser.utils'), # submodule - (utils, 'qutebrowser.utils.utils'), # submodule (from-import) -], ids=['instance', 'class', 'unbound-method', 'bound-method', 'function', - 'partial', 'module', 'submodule', 'from-import']) + pytest.param(QUALNAME_OBJ, repr(QUALNAME_OBJ), id='instance'), + pytest.param(QualnameObj, 'test_utils.QualnameObj', id='class'), + pytest.param(QualnameObj.func, 'test_utils.QualnameObj.func', + id='unbound-method'), + pytest.param(QualnameObj().func, 'test_utils.QualnameObj.func', + id='bound-method'), + pytest.param(qualname_func, 'test_utils.qualname_func', id='function'), + pytest.param(functools.partial(qualname_func, True), + 'test_utils.qualname_func', id='partial'), + pytest.param(qutebrowser, 'qutebrowser', id='module'), + pytest.param(qutebrowser.utils, 'qutebrowser.utils', id='submodule'), + pytest.param(utils, 'qutebrowser.utils.utils', id='from-import'), +]) def test_qualname(obj, expected): assert utils.qualname(obj) == expected |