Remove redundant parentheses

This commit is contained in:
Hugo 2017-12-18 13:59:02 +02:00
parent 31a5b5d7e7
commit 676e86d683
4 changed files with 10 additions and 10 deletions

@ -51,7 +51,7 @@ parser.add_option("-c", "--config-file",
help=("Specify the path to the buildout configuration " help=("Specify the path to the buildout configuration "
"file to be used.")) "file to be used."))
parser.add_option("-f", "--find-links", parser.add_option("-f", "--find-links",
help=("Specify a URL to search for buildout releases")) help="Specify a URL to search for buildout releases")
options, args = parser.parse_args() options, args = parser.parse_args()

@ -233,7 +233,7 @@ def main(argv=None):
c.password_file = v c.password_file = v
elif k in ("-o", "--overwrite"): elif k in ("-o", "--overwrite"):
c.overwrite = True c.overwrite = True
elif k in ("--hash-algo"): elif k in "--hash-algo":
c.hash_algo = None if not pypiserver.str2bool(v, c.hash_algo) else v c.hash_algo = None if not pypiserver.str2bool(v, c.hash_algo) else v
elif k == "--log-file": elif k == "--log-file":
c.log_file = v c.log_file = v

@ -1380,7 +1380,7 @@ class BaseRequest(object):
basic = parse_auth(self.environ.get('HTTP_AUTHORIZATION', '')) basic = parse_auth(self.environ.get('HTTP_AUTHORIZATION', ''))
if basic: return basic if basic: return basic
ruser = self.environ.get('REMOTE_USER') ruser = self.environ.get('REMOTE_USER')
if ruser: return (ruser, None) if ruser: return ruser, None
return None return None
@property @property

@ -381,9 +381,9 @@ def test_upload_badAction(root, testapp):
assert "Unsupported ':action' field: BAD" in hp.unescape(resp.text) assert "Unsupported ':action' field: BAD" in hp.unescape(resp.text)
@pytest.mark.parametrize(("package"), [f[0] @pytest.mark.parametrize("package", [f[0]
for f in test_core.files for f in test_core.files
if f[1] and '/' not in f[0]]) if f[1] and '/' not in f[0]])
def test_upload(package, root, testapp): def test_upload(package, root, testapp):
resp = testapp.post("/", params={':action': 'file_upload'}, resp = testapp.post("/", params={':action': 'file_upload'},
upload_files=[('content', package, b'')]) upload_files=[('content', package, b'')])
@ -393,9 +393,9 @@ def test_upload(package, root, testapp):
assert uploaded_pkgs[0].lower() == package.lower() assert uploaded_pkgs[0].lower() == package.lower()
@pytest.mark.parametrize(("package"), [f[0] @pytest.mark.parametrize("package", [f[0]
for f in test_core.files for f in test_core.files
if f[1] and '/' not in f[0]]) if f[1] and '/' not in f[0]])
def test_upload_with_signature(package, root, testapp): def test_upload_with_signature(package, root, testapp):
resp = testapp.post("/", params={':action': 'file_upload'}, resp = testapp.post("/", params={':action': 'file_upload'},
upload_files=[ upload_files=[
@ -408,7 +408,7 @@ def test_upload_with_signature(package, root, testapp):
assert '%s.asc' % package.lower() in uploaded_pkgs assert '%s.asc' % package.lower() in uploaded_pkgs
@pytest.mark.parametrize(("package"), [ @pytest.mark.parametrize("package", [
f[0] for f in test_core.files f[0] for f in test_core.files
if f[1] is None]) if f[1] is None])
def test_upload_badFilename(package, root, testapp): def test_upload_badFilename(package, root, testapp):