Conversation
| patterns = [ r'\b{}\b'.format(x) for x in | ||
| ('exception', 'error', 'warning', 'fatal', 'traceback', | ||
| 'fault', 'crash(?:ed)?', 'abort(?:ed)', | ||
| 'uninitiali[zs]ed') ] | ||
| patterns = [ | ||
| f'\b{x}\b' | ||
| for x in ( | ||
| 'exception', | ||
| 'error', | ||
| 'warning', | ||
| 'fatal', | ||
| 'traceback', | ||
| 'fault', | ||
| 'crash(?:ed)?', | ||
| 'abort(?:ed)', | ||
| 'uninitiali[zs]ed', | ||
| ) | ||
| ] | ||
| patterns += ['^==[0-9]+== '] | ||
| for pattern in patterns: | ||
| cp = re.compile(pattern, re.IGNORECASE | re.MULTILINE) | ||
| hit = cp.search(stderr) | ||
| if hit: | ||
| raise AssertionError('Suspicious output to stderr (matched "%s")' % hit.group(0)) | ||
| hit = cp.search(stdout) | ||
| if hit: | ||
| raise AssertionError('Suspicious output to stdout (matched "%s")' % hit.group(0)) | ||
| if hit := cp.search(stderr): | ||
| raise AssertionError(f'Suspicious output to stderr (matched "{hit[0]}")') | ||
| if hit := cp.search(stdout): | ||
| raise AssertionError(f'Suspicious output to stdout (matched "{hit[0]}")') |
There was a problem hiding this comment.
Function check_test_output refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting) - Use named expression to simplify assignment and conditional [×2] (
use-named-expression) - Replace interpolated string formatting with f-string [×2] (
replace-interpolation-with-fstring) - Replace m.group(x) with m[x] for re.Match objects [×2] (
use-getitem-for-re-match-groups)
| cmdline = base_cmdline + [ pjoin(basename, 'sshfs'), | ||
| '-f', 'localhost:' + src_dir, mnt_dir ] | ||
| cmdline = base_cmdline + [ | ||
| pjoin(basename, 'sshfs'), | ||
| '-f', | ||
| f'localhost:{src_dir}', | ||
| mnt_dir, | ||
| ] |
There was a problem hiding this comment.
Function test_sshfs refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
| fullname = mnt_dir + "/" + name | ||
| fullname = f"{mnt_dir}/{name}" |
There was a problem hiding this comment.
Function tst_unlink refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
| fullname = mnt_dir + "/" + dirname | ||
| fullname = f"{mnt_dir}/{dirname}" |
There was a problem hiding this comment.
Function tst_mkdir refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
| fullname = mnt_dir + "/" + name | ||
| fullname = f"{mnt_dir}/{name}" |
There was a problem hiding this comment.
Function tst_rmdir refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
| fullname = mnt_dir + "/" + linkname | ||
| fullname = f"{mnt_dir}/{linkname}" |
There was a problem hiding this comment.
Function tst_symlink refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
| file_ = src_newdir + "/" + name_generator() | ||
| subdir = src_newdir + "/" + name_generator() | ||
| subfile = subdir + "/" + name_generator() | ||
| file_ = f"{src_newdir}/{name_generator()}" | ||
| subdir = f"{src_newdir}/{name_generator()}" | ||
| subfile = f"{subdir}/{name_generator()}" |
There was a problem hiding this comment.
Function tst_readdir refactored with the following changes:
- Use f-string instead of string concatenation [×6] (
use-fstring-for-concatenation)
| if code == 0: | ||
| return | ||
| pytest.fail('file system process terminated with code %s' % (code,)) | ||
| pytest.fail(f'file system process terminated with code {code}') |
There was a problem hiding this comment.
Function umount refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| fd = os.open('/dev/fuse', os.O_RDWR) | ||
| except OSError as exc: | ||
| return skip('Unable to open /dev/fuse: %s' % exc.strerror) | ||
| return skip(f'Unable to open /dev/fuse: {exc.strerror}') |
There was a problem hiding this comment.
Function fuse_test_marker refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
Branch
masterrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run:Help us improve this pull request!