-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sourcery refactored master branch #1
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function tst_readdir
refactored with the following changes:
- Use f-string instead of string concatenation [×6] (
use-fstring-for-concatenation
)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function umount
refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring
)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function fuse_test_marker
refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring
)
Branch
master
refactored 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
master
branch, then run:Help us improve this pull request!