From 1087dece0147093d82c3cc68f5dc62f5115979ac Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 26 Nov 2019 03:24:42 +0100 Subject: [PATCH] Switch namespace_none test to check all calls Instead of all input parameter types for one call. This is better since more calls are checked, and the parameter type checking is not the goal of this test. --- test/test_xattr.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/test_xattr.py b/test/test_xattr.py index 2a8a634..0a5fbdf 100644 --- a/test/test_xattr.py +++ b/test/test_xattr.py @@ -386,9 +386,21 @@ def test_symlinks_user_fail(testdir, use_dangling): with pytest.raises(IOError): xattr.setxattr(sname, USER_ATTR, USER_VAL, XATTR_CREATE, True) -def test_none_namespace(subject): +@pytest.mark.parametrize( + "call, args", [(xattr.get, [USER_ATTR]), + (xattr.list, []), + (xattr.remove, [USER_ATTR]), + (xattr.get, [USER_ATTR]), + (xattr.set, [USER_ATTR, USER_VAL])]) +def test_none_namespace(testdir, call, args): + # Don't want to use subject, since that would prevent xfail test + # on path objects (due to hiding the exception here). + f = get_file_name(testdir) + with pytest.raises(TypeError): + call(f, *args, namespace=None) + fd = get_file_fd(testdir) with pytest.raises(TypeError): - xattr.get(subject[0], USER_ATTR, namespace=None) + call(fd, *args, namespace=None) @pytest.mark.parametrize( "call", -- 2.39.5