Skip to content

Commit

Permalink
format test file with black
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateus Latrova committed Oct 2, 2023
1 parent 98fb469 commit e6d2585
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions tests/test_pipreqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def setUp(self):
self.project = os.path.join(os.path.dirname(__file__), "_data")
self.project_clean = os.path.join(os.path.dirname(__file__), "_data_clean")
self.project_invalid = os.path.join(os.path.dirname(__file__), "_invalid_data")
self.parsed_packages = [{'name': 'pandas', 'version': '2.0.0'}, {'name': 'numpy', 'version': '1.2.3'}, {'name': 'torch', 'version': '4.0.0'}]
self.parsed_packages = [
{"name": "pandas", "version": "2.0.0"},
{"name": "numpy", "version": "1.2.3"},
{"name": "torch", "version": "4.0.0"},
]
self.empty_filepath = os.path.join(self.project, "empty.txt")
self.imports_filepath = os.path.join(self.project, "imports.txt")
self.project_with_ignore_directory = os.path.join(
Expand Down Expand Up @@ -432,11 +436,19 @@ def test_clean_with_imports_to_clean(self):

def test_compare_modules(self):
test_cases = [
( self.empty_filepath, [], set() ), # both empty
( self.empty_filepath, self.parsed_packages, set() ), # only file empty
( self.imports_filepath, [], set(package["name"] for package in self.parsed_packages) ), # only imports empty
( self.imports_filepath, self.parsed_packages, set() ), # no difference
( self.imports_filepath, self.parsed_packages[1:], set([self.parsed_packages[0]["name"]]) ) # common case
(self.empty_filepath, [], set()), # both empty
(self.empty_filepath, self.parsed_packages, set()), # only file empty
(
self.imports_filepath,
[],
set(package["name"] for package in self.parsed_packages),
), # only imports empty
(self.imports_filepath, self.parsed_packages, set()), # no difference
(
self.imports_filepath,
self.parsed_packages[1:],
set([self.parsed_packages[0]["name"]]),
), # common case
]

for test_case in test_cases:
Expand Down

0 comments on commit e6d2585

Please sign in to comment.