mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 19:45:22 +00:00
applying pep8 rules
This commit is contained in:
parent
e7571ea033
commit
f2e745256e
@ -16,45 +16,43 @@ from pipreqs import pipreqs
|
|||||||
|
|
||||||
|
|
||||||
class TestPipreqs(unittest.TestCase):
|
class TestPipreqs(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.modules = [
|
self.modules = [
|
||||||
'flask', 'requests', 'sqlalchemy', 'docopt', 'boto', 'ipython',
|
"flask",
|
||||||
'pyflakes', 'nose', 'analytics', 'flask_seasurf', 'peewee',
|
"requests",
|
||||||
'ujson', 'nonexistendmodule', 'bs4',
|
"sqlalchemy",
|
||||||
'after_method_is_valid_even_if_not_pep8'
|
"docopt",
|
||||||
]
|
"boto",
|
||||||
self.modules2 = ['beautifulsoup4']
|
"ipython",
|
||||||
self.local = ["docopt", "requests", "nose", 'pyflakes']
|
"pyflakes",
|
||||||
|
"nose",
|
||||||
|
"analytics",
|
||||||
|
"flask_seasurf",
|
||||||
|
"peewee",
|
||||||
|
"ujson",
|
||||||
|
"nonexistendmodule",
|
||||||
|
"bs4",
|
||||||
|
"after_method_is_valid_even_if_not_pep8",
|
||||||
|
]
|
||||||
|
self.modules2 = ["beautifulsoup4"]
|
||||||
|
self.local = ["docopt", "requests", "nose", "pyflakes"]
|
||||||
self.project = os.path.join(os.path.dirname(__file__), "_data")
|
self.project = os.path.join(os.path.dirname(__file__), "_data")
|
||||||
self.project_clean = os.path.join(
|
self.project_clean = os.path.join(os.path.dirname(__file__), "_data_clean")
|
||||||
os.path.dirname(__file__),
|
self.project_invalid = os.path.join(os.path.dirname(__file__), "_invalid_data")
|
||||||
"_data_clean"
|
|
||||||
)
|
|
||||||
self.project_invalid = os.path.join(
|
|
||||||
os.path.dirname(__file__),
|
|
||||||
"_invalid_data"
|
|
||||||
)
|
|
||||||
self.project_with_ignore_directory = os.path.join(
|
self.project_with_ignore_directory = os.path.join(
|
||||||
os.path.dirname(__file__),
|
os.path.dirname(__file__), "_data_ignore"
|
||||||
"_data_ignore"
|
)
|
||||||
)
|
|
||||||
self.project_with_duplicated_deps = os.path.join(
|
self.project_with_duplicated_deps = os.path.join(
|
||||||
os.path.dirname(__file__),
|
os.path.dirname(__file__), "_data_duplicated_deps"
|
||||||
"_data_duplicated_deps"
|
)
|
||||||
)
|
|
||||||
self.requirements_path = os.path.join(self.project, "requirements.txt")
|
self.requirements_path = os.path.join(self.project, "requirements.txt")
|
||||||
self.alt_requirement_path = os.path.join(
|
self.alt_requirement_path = os.path.join(self.project, "requirements2.txt")
|
||||||
self.project,
|
|
||||||
"requirements2.txt"
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_get_all_imports(self):
|
def test_get_all_imports(self):
|
||||||
imports = pipreqs.get_all_imports(self.project)
|
imports = pipreqs.get_all_imports(self.project)
|
||||||
self.assertEqual(len(imports), 15)
|
self.assertEqual(len(imports), 15)
|
||||||
for item in imports:
|
for item in imports:
|
||||||
self.assertTrue(
|
self.assertTrue(item.lower() in self.modules, "Import is missing: " + item)
|
||||||
item.lower() in self.modules, "Import is missing: " + item)
|
|
||||||
self.assertFalse("time" in imports)
|
self.assertFalse("time" in imports)
|
||||||
self.assertFalse("logging" in imports)
|
self.assertFalse("logging" in imports)
|
||||||
self.assertFalse("curses" in imports)
|
self.assertFalse("curses" in imports)
|
||||||
@ -72,8 +70,7 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
Test that invalid python files cannot be imported.
|
Test that invalid python files cannot be imported.
|
||||||
"""
|
"""
|
||||||
self.assertRaises(
|
self.assertRaises(SyntaxError, pipreqs.get_all_imports, self.project_invalid)
|
||||||
SyntaxError, pipreqs.get_all_imports, self.project_invalid)
|
|
||||||
|
|
||||||
def test_get_imports_info(self):
|
def test_get_imports_info(self):
|
||||||
"""
|
"""
|
||||||
@ -86,13 +83,14 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
self.assertEqual(len(with_info), 13)
|
self.assertEqual(len(with_info), 13)
|
||||||
for item in with_info:
|
for item in with_info:
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
item['name'].lower() in self.modules,
|
item["name"].lower() in self.modules,
|
||||||
"Import item appears to be missing " + item['name'])
|
"Import item appears to be missing " + item["name"],
|
||||||
|
)
|
||||||
|
|
||||||
def test_get_pkg_names(self):
|
def test_get_pkg_names(self):
|
||||||
pkgs = ['jury', 'Japan', 'camel', 'Caroline']
|
pkgs = ["jury", "Japan", "camel", "Caroline"]
|
||||||
actual_output = pipreqs.get_pkg_names(pkgs)
|
actual_output = pipreqs.get_pkg_names(pkgs)
|
||||||
expected_output = ['camel', 'Caroline', 'Japan', 'jury']
|
expected_output = ["camel", "Caroline", "Japan", "jury"]
|
||||||
self.assertEqual(actual_output, expected_output)
|
self.assertEqual(actual_output, expected_output)
|
||||||
|
|
||||||
def test_get_use_local_only(self):
|
def test_get_use_local_only(self):
|
||||||
@ -107,22 +105,33 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
# should find only docopt and requests
|
# should find only docopt and requests
|
||||||
imports_with_info = pipreqs.get_import_local(self.modules)
|
imports_with_info = pipreqs.get_import_local(self.modules)
|
||||||
for item in imports_with_info:
|
for item in imports_with_info:
|
||||||
self.assertTrue(item['name'].lower() in self.local)
|
self.assertTrue(item["name"].lower() in self.local)
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
"""
|
"""
|
||||||
Test that all modules we will test upon are in requirements file
|
Test that all modules we will test upon are in requirements file
|
||||||
"""
|
"""
|
||||||
pipreqs.init({'<path>': self.project, '--savepath': None, '--print': False,
|
pipreqs.init(
|
||||||
'--use-local': None, '--force': True, '--proxy':None, '--pypi-server':None,
|
{
|
||||||
'--diff': None, '--clean': None, '--mode': None})
|
"<path>": self.project,
|
||||||
|
"--savepath": None,
|
||||||
|
"--print": False,
|
||||||
|
"--use-local": None,
|
||||||
|
"--force": True,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": None,
|
||||||
|
}
|
||||||
|
)
|
||||||
assert os.path.exists(self.requirements_path) == 1
|
assert os.path.exists(self.requirements_path) == 1
|
||||||
with open(self.requirements_path, "r") as f:
|
with open(self.requirements_path, "r") as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
for item in self.modules[:-3]:
|
for item in self.modules[:-3]:
|
||||||
self.assertTrue(item.lower() in data)
|
self.assertTrue(item.lower() in data)
|
||||||
# It should be sorted based on names.
|
# It should be sorted based on names.
|
||||||
data = data.strip().split('\n')
|
data = data.strip().split("\n")
|
||||||
self.assertEqual(data, sorted(data))
|
self.assertEqual(data, sorted(data))
|
||||||
|
|
||||||
def test_init_local_only(self):
|
def test_init_local_only(self):
|
||||||
@ -130,9 +139,20 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test that items listed in requirements.text are the same
|
Test that items listed in requirements.text are the same
|
||||||
as locals expected
|
as locals expected
|
||||||
"""
|
"""
|
||||||
pipreqs.init({'<path>': self.project, '--savepath': None, '--print': False,
|
pipreqs.init(
|
||||||
'--use-local': True, '--force': True, '--proxy':None, '--pypi-server':None,
|
{
|
||||||
'--diff': None, '--clean': None, '--mode': None})
|
"<path>": self.project,
|
||||||
|
"--savepath": None,
|
||||||
|
"--print": False,
|
||||||
|
"--use-local": True,
|
||||||
|
"--force": True,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": None,
|
||||||
|
}
|
||||||
|
)
|
||||||
assert os.path.exists(self.requirements_path) == 1
|
assert os.path.exists(self.requirements_path) == 1
|
||||||
with open(self.requirements_path, "r") as f:
|
with open(self.requirements_path, "r") as f:
|
||||||
data = f.readlines()
|
data = f.readlines()
|
||||||
@ -145,9 +165,19 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test that we can save requirements.txt correctly
|
Test that we can save requirements.txt correctly
|
||||||
to a different path
|
to a different path
|
||||||
"""
|
"""
|
||||||
pipreqs.init({'<path>': self.project, '--savepath': self.alt_requirement_path,
|
pipreqs.init(
|
||||||
'--use-local': None, '--proxy':None, '--pypi-server':None, '--print': False,
|
{
|
||||||
'--diff': None, '--clean': None, '--mode': None})
|
"<path>": self.project,
|
||||||
|
"--savepath": self.alt_requirement_path,
|
||||||
|
"--use-local": None,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--print": False,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": None,
|
||||||
|
}
|
||||||
|
)
|
||||||
assert os.path.exists(self.alt_requirement_path) == 1
|
assert os.path.exists(self.alt_requirement_path) == 1
|
||||||
with open(self.alt_requirement_path, "r") as f:
|
with open(self.alt_requirement_path, "r") as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
@ -163,9 +193,20 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
with open(self.requirements_path, "w") as f:
|
with open(self.requirements_path, "w") as f:
|
||||||
f.write("should_not_be_overwritten")
|
f.write("should_not_be_overwritten")
|
||||||
pipreqs.init({'<path>': self.project, '--savepath': None, '--use-local': None,
|
pipreqs.init(
|
||||||
'--force': None, '--proxy':None, '--pypi-server':None, '--print': False,
|
{
|
||||||
'--diff': None, '--clean': None, '--mode': None})
|
"<path>": self.project,
|
||||||
|
"--savepath": None,
|
||||||
|
"--use-local": None,
|
||||||
|
"--force": None,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--print": False,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": None,
|
||||||
|
}
|
||||||
|
)
|
||||||
assert os.path.exists(self.requirements_path) == 1
|
assert os.path.exists(self.requirements_path) == 1
|
||||||
with open(self.requirements_path, "r") as f:
|
with open(self.requirements_path, "r") as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
@ -181,40 +222,54 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
import_name_with_alias = "requests as R"
|
import_name_with_alias = "requests as R"
|
||||||
expected_import_name_without_alias = "requests"
|
expected_import_name_without_alias = "requests"
|
||||||
import_name_without_aliases = pipreqs.get_name_without_alias(
|
import_name_without_aliases = pipreqs.get_name_without_alias(
|
||||||
import_name_with_alias)
|
import_name_with_alias
|
||||||
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
import_name_without_aliases,
|
import_name_without_aliases, expected_import_name_without_alias
|
||||||
expected_import_name_without_alias
|
)
|
||||||
)
|
|
||||||
|
|
||||||
def test_custom_pypi_server(self):
|
def test_custom_pypi_server(self):
|
||||||
"""
|
"""
|
||||||
Test that trying to get a custom pypi sever fails correctly
|
Test that trying to get a custom pypi sever fails correctly
|
||||||
"""
|
"""
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
requests.exceptions.MissingSchema, pipreqs.init,
|
requests.exceptions.MissingSchema,
|
||||||
{'<path>': self.project, '--savepath': None, '--print': False,
|
pipreqs.init,
|
||||||
'--use-local': None, '--force': True, '--proxy': None,
|
{
|
||||||
'--pypi-server': 'nonexistent'}
|
"<path>": self.project,
|
||||||
)
|
"--savepath": None,
|
||||||
|
"--print": False,
|
||||||
|
"--use-local": None,
|
||||||
|
"--force": True,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": "nonexistent",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
def test_ignored_directory(self):
|
def test_ignored_directory(self):
|
||||||
"""
|
"""
|
||||||
Test --ignore parameter
|
Test --ignore parameter
|
||||||
"""
|
"""
|
||||||
pipreqs.init(
|
pipreqs.init(
|
||||||
{'<path>': self.project_with_ignore_directory, '--savepath': None,
|
{
|
||||||
'--print': False, '--use-local': None, '--force': True,
|
"<path>": self.project_with_ignore_directory,
|
||||||
'--proxy':None, '--pypi-server':None,
|
"--savepath": None,
|
||||||
'--ignore':'.ignored_dir,.ignore_second',
|
"--print": False,
|
||||||
'--diff': None,
|
"--use-local": None,
|
||||||
'--clean': None,
|
"--force": True,
|
||||||
'--mode': None
|
"--proxy": None,
|
||||||
}
|
"--pypi-server": None,
|
||||||
|
"--ignore": ".ignored_dir,.ignore_second",
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": None,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
with open(os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r") as f:
|
with open(
|
||||||
|
os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r"
|
||||||
|
) as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
for item in ['click', 'getpass']:
|
for item in ["click", "getpass"]:
|
||||||
self.assertFalse(item.lower() in data)
|
self.assertFalse(item.lower() in data)
|
||||||
|
|
||||||
def test_dynamic_version_no_pin_scheme(self):
|
def test_dynamic_version_no_pin_scheme(self):
|
||||||
@ -222,17 +277,24 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test --mode=no-pin
|
Test --mode=no-pin
|
||||||
"""
|
"""
|
||||||
pipreqs.init(
|
pipreqs.init(
|
||||||
{'<path>': self.project_with_ignore_directory, '--savepath': None,
|
{
|
||||||
'--print': False, '--use-local': None, '--force': True,
|
"<path>": self.project_with_ignore_directory,
|
||||||
'--proxy': None, '--pypi-server': None,
|
"--savepath": None,
|
||||||
'--diff': None,
|
"--print": False,
|
||||||
'--clean': None,
|
"--use-local": None,
|
||||||
'--mode': 'no-pin'
|
"--force": True,
|
||||||
}
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": "no-pin",
|
||||||
|
}
|
||||||
)
|
)
|
||||||
with open(os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r") as f:
|
with open(
|
||||||
|
os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r"
|
||||||
|
) as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
for item in ['beautifulsoup4', 'boto']:
|
for item in ["beautifulsoup4", "boto"]:
|
||||||
self.assertTrue(item.lower() in data)
|
self.assertTrue(item.lower() in data)
|
||||||
|
|
||||||
def test_dynamic_version_gt_scheme(self):
|
def test_dynamic_version_gt_scheme(self):
|
||||||
@ -240,20 +302,26 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test --mode=gt
|
Test --mode=gt
|
||||||
"""
|
"""
|
||||||
pipreqs.init(
|
pipreqs.init(
|
||||||
{'<path>': self.project_with_ignore_directory, '--savepath': None, '--print': False,
|
{
|
||||||
'--use-local': None, '--force': True,
|
"<path>": self.project_with_ignore_directory,
|
||||||
'--proxy': None,
|
"--savepath": None,
|
||||||
'--pypi-server': None,
|
"--print": False,
|
||||||
'--diff': None,
|
"--use-local": None,
|
||||||
'--clean': None,
|
"--force": True,
|
||||||
'--mode': 'gt'
|
"--proxy": None,
|
||||||
}
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": "gt",
|
||||||
|
}
|
||||||
)
|
)
|
||||||
with open(os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r") as f:
|
with open(
|
||||||
|
os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r"
|
||||||
|
) as f:
|
||||||
data = f.readlines()
|
data = f.readlines()
|
||||||
for item in data:
|
for item in data:
|
||||||
symbol = '>='
|
symbol = ">="
|
||||||
message = 'symbol is not in item'
|
message = "symbol is not in item"
|
||||||
self.assertIn(symbol, item, message)
|
self.assertIn(symbol, item, message)
|
||||||
|
|
||||||
def test_dynamic_version_compat_scheme(self):
|
def test_dynamic_version_compat_scheme(self):
|
||||||
@ -261,20 +329,26 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test --mode=compat
|
Test --mode=compat
|
||||||
"""
|
"""
|
||||||
pipreqs.init(
|
pipreqs.init(
|
||||||
{'<path>': self.project_with_ignore_directory, '--savepath': None, '--print': False,
|
{
|
||||||
'--use-local': None, '--force': True,
|
"<path>": self.project_with_ignore_directory,
|
||||||
'--proxy': None,
|
"--savepath": None,
|
||||||
'--pypi-server': None,
|
"--print": False,
|
||||||
'--diff': None,
|
"--use-local": None,
|
||||||
'--clean': None,
|
"--force": True,
|
||||||
'--mode': 'compat'
|
"--proxy": None,
|
||||||
}
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": "compat",
|
||||||
|
}
|
||||||
)
|
)
|
||||||
with open(os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r") as f:
|
with open(
|
||||||
|
os.path.join(self.project_with_ignore_directory, "requirements.txt"), "r"
|
||||||
|
) as f:
|
||||||
data = f.readlines()
|
data = f.readlines()
|
||||||
for item in data:
|
for item in data:
|
||||||
symbol = '~='
|
symbol = "~="
|
||||||
message = 'symbol is not in item'
|
message = "symbol is not in item"
|
||||||
self.assertIn(symbol, item, message)
|
self.assertIn(symbol, item, message)
|
||||||
|
|
||||||
def test_clean(self):
|
def test_clean(self):
|
||||||
@ -282,18 +356,34 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
Test --clean parameter
|
Test --clean parameter
|
||||||
"""
|
"""
|
||||||
pipreqs.init(
|
pipreqs.init(
|
||||||
{'<path>': self.project, '--savepath': None, '--print': False,
|
{
|
||||||
'--use-local': None, '--force': True, '--proxy': None,
|
"<path>": self.project,
|
||||||
'--pypi-server': None, '--diff': None, '--clean': None,
|
"--savepath": None,
|
||||||
'--mode': None}
|
"--print": False,
|
||||||
)
|
"--use-local": None,
|
||||||
|
"--force": True,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": None,
|
||||||
|
}
|
||||||
|
)
|
||||||
assert os.path.exists(self.requirements_path) == 1
|
assert os.path.exists(self.requirements_path) == 1
|
||||||
pipreqs.init(
|
pipreqs.init(
|
||||||
{'<path>': self.project, '--savepath': None, '--print': False,
|
{
|
||||||
'--use-local': None, '--force': None, '--proxy': None,
|
"<path>": self.project,
|
||||||
'--pypi-server': None, '--diff': None,
|
"--savepath": None,
|
||||||
'--clean': self.requirements_path, '--mode': 'non-pin'}
|
"--print": False,
|
||||||
)
|
"--use-local": None,
|
||||||
|
"--force": None,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": self.requirements_path,
|
||||||
|
"--mode": "non-pin",
|
||||||
|
}
|
||||||
|
)
|
||||||
with open(self.requirements_path, "r") as f:
|
with open(self.requirements_path, "r") as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
for item in self.modules[:-3]:
|
for item in self.modules[:-3]:
|
||||||
@ -303,21 +393,36 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
Test --clean parameter when there are imports to clean
|
Test --clean parameter when there are imports to clean
|
||||||
"""
|
"""
|
||||||
cleaned_module = 'sqlalchemy'
|
cleaned_module = "sqlalchemy"
|
||||||
pipreqs.init(
|
pipreqs.init(
|
||||||
{'<path>': self.project, '--savepath': None, '--print': False,
|
{
|
||||||
'--use-local': None, '--force': True, '--proxy': None,
|
"<path>": self.project,
|
||||||
'--pypi-server': None, '--diff': None, '--clean': None,
|
"--savepath": None,
|
||||||
'--mode': None}
|
"--print": False,
|
||||||
)
|
"--use-local": None,
|
||||||
|
"--force": True,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": None,
|
||||||
|
"--mode": None,
|
||||||
|
}
|
||||||
|
)
|
||||||
assert os.path.exists(self.requirements_path) == 1
|
assert os.path.exists(self.requirements_path) == 1
|
||||||
modules_clean = [m for m in self.modules if m != cleaned_module]
|
|
||||||
pipreqs.init(
|
pipreqs.init(
|
||||||
{'<path>': self.project_clean, '--savepath': None,
|
{
|
||||||
'--print': False, '--use-local': None, '--force': None,
|
"<path>": self.project_clean,
|
||||||
'--proxy': None, '--pypi-server': None, '--diff': None,
|
"--savepath": None,
|
||||||
'--clean': self.requirements_path, '--mode': 'non-pin'}
|
"--print": False,
|
||||||
)
|
"--use-local": None,
|
||||||
|
"--force": None,
|
||||||
|
"--proxy": None,
|
||||||
|
"--pypi-server": None,
|
||||||
|
"--diff": None,
|
||||||
|
"--clean": self.requirements_path,
|
||||||
|
"--mode": "non-pin",
|
||||||
|
}
|
||||||
|
)
|
||||||
with open(self.requirements_path, "r") as f:
|
with open(self.requirements_path, "r") as f:
|
||||||
data = f.read().lower()
|
data = f.read().lower()
|
||||||
self.assertTrue(cleaned_module not in data)
|
self.assertTrue(cleaned_module not in data)
|
||||||
@ -336,5 +441,5 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
9
tox.ini
9
tox.ini
@ -15,3 +15,12 @@ setenv =
|
|||||||
commands = python setup.py test
|
commands = python setup.py test
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
exclude =
|
||||||
|
tests/_data/
|
||||||
|
tests/_data_clean/
|
||||||
|
tests/_data_duplicated_deps/
|
||||||
|
tests/_data_ignore/
|
||||||
|
tests/_invalid_data/
|
||||||
|
max-line-length = 120
|
||||||
|
Loading…
x
Reference in New Issue
Block a user