From 061a9b5f64b53ff1befdfd8175b8110aa20645da Mon Sep 17 00:00:00 2001 From: EJ Lee Date: Tue, 20 Oct 2015 19:51:39 +0900 Subject: [PATCH] fixed lint warnings --- pipreqs/pipreqs.py | 5 ++--- tests/test_pipreqs.py | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pipreqs/pipreqs.py b/pipreqs/pipreqs.py index e6d28ac..2100a4e 100755 --- a/pipreqs/pipreqs.py +++ b/pipreqs/pipreqs.py @@ -95,7 +95,7 @@ def get_imports_info(imports, pypi_server="https://pypi.python.org/pypi/", proxy data = json2package(response.content) elif response.status_code >= 300: raise HTTPError(status_code=response.status_code, - reason=response.reason) + reason=response.reason) except HTTPError: logging.debug( 'Package %s does not exist or network problems', item) @@ -173,7 +173,7 @@ def init(args): pypi_server = args["--pypi-server"] if args["--proxy"]: - proxy = {'http':args["--proxy"], 'https':args["--proxy"]} + proxy = {'http': args["--proxy"], 'https': args["--proxy"]} if args["--use-local"]: logging.debug( @@ -192,7 +192,6 @@ def init(args): path = (args["--savepath"] if args["--savepath"] else os.path.join(args[''], "requirements.txt")) - if not args["--savepath"] and not args["--force"] and os.path.exists(path): logging.warning("Requirements.txt already exists, " "use --force to overwrite it") diff --git a/tests/test_pipreqs.py b/tests/test_pipreqs.py index b24a8b8..acf26d8 100755 --- a/tests/test_pipreqs.py +++ b/tests/test_pipreqs.py @@ -105,11 +105,9 @@ class TestPipreqs(unittest.TestCase): self.assertEqual( import_name_without_aliases, expected_import_name_without_alias) - def test_custom_pypi_server(self): self.assertRaises(requests.exceptions.MissingSchema, pipreqs.init, {'': self.project, '--savepath': None, - '--use-local': None, '--force': True, '--proxy':None, '--pypi-server':'nonexistent'}) - + '--use-local': None, '--force': True, '--proxy': None, '--pypi-server': 'nonexistent'}) def tearDown(self): try: