diff options
author | Matthias Goergens <matthias.goergens@gmail.com> | 2023-04-07 15:39:21 +0800 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2023-04-07 15:31:58 +0100 |
commit | 6ce27f48bc6bb797c4d3953572e00e9579f0af87 (patch) | |
tree | 6841f495dc15e5e154ff8d68efe00d53e3ed79c9 /test/util.py | |
parent | b9b4307e4da12278ef202ddccc39344f3eb61735 (diff) | |
download | fuse-6ce27f48bc6bb797c4d3953572e00e9579f0af87.tar.gz |
Fix PytestReturnNotNoneWarning
```
test_examples.py::test_printcap
/usr/local/lib/python3.9/dist-packages/_pytest/python.py:199: PytestReturnNotNoneWarning: Expected None, but test_examples.py::test_printcap returned ((7, 38), {'FUSE_CAP_READDIRPLUS_AUTO', 'FUSE_CAP_ASYNC_DIO', 'FUSE_CAP_SPLICE_READ', 'FUSE_CAP_CACHE_SYMLINKS', 'FUSE_CAP_IOCTL_DIR', 'FUSE_CAP_NO_OPENDIR_SUPPORT', 'FUSE_CAP_NO_OPEN_SUPPORT', 'FUSE_CAP_POSIX_LOCKS', 'FUSE_CAP_READDIRPLUS', 'FUSE_CAP_POSIX_ACL', 'FUSE_CAP_ATOMIC_O_TRUNC', 'FUSE_CAP_SPLICE_MOVE', 'FUSE_CAP_EXPORT_SUPPORT', 'FUSE_CAP_FLOCK_LOCKS', 'FUSE_CAP_EXPLICIT_INVAL_DATA', 'FUSE_CAP_EXPIRE_ONLY', 'FUSE_CAP_DONT_MASK', 'FUSE_CAP_WRITEBACK_CACHE', 'FUSE_CAP_AUTO_INVAL_DATA', 'FUSE_CAP_PARALLEL_DIROPS', 'FUSE_CAP_SPLICE_WRITE', 'FUSE_CAP_ASYNC_READ'}), which will be an error in a future version of pytest. Did you mean to use `assert` instead of `return`?
warnings.warn(
```
Diffstat (limited to 'test/util.py')
-rw-r--r-- | test/util.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/util.py b/test/util.py index 8bef265..0a1fa93 100644 --- a/test/util.py +++ b/test/util.py @@ -11,7 +11,7 @@ import itertools basename = pjoin(os.path.dirname(__file__), '..') -def test_printcap(): +def get_printcap(): cmdline = base_cmdline + [ pjoin(basename, 'example', 'printcap') ] proc = subprocess.Popen(cmdline, stdout=subprocess.PIPE, universal_newlines=True) @@ -31,6 +31,8 @@ def test_printcap(): return (proto, caps) +def test_printcap(): + get_printcap() def wait_for_mount(mount_process, mnt_dir, test_fn=os.path.ismount): @@ -163,7 +165,7 @@ os.environ['PATH'] = '%s:%s' % (pjoin(basename, 'util'), os.environ['PATH']) os.environ['PATH'] = '%s:%s' % (pjoin(basename, 'example'), os.environ['PATH']) try: - (fuse_proto, fuse_caps) = test_printcap() + (fuse_proto, fuse_caps) = get_printcap() except: # Rely on test to raise error fuse_proto = (0,0) |