How to use the pipreqs.pipreqs.get_import_local function in pipreqs

To help you get started, we’ve selected a few pipreqs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bndr / pipreqs / tests / test_pipreqs.py View on Github external
def test_get_use_local_only(self):
        """
        Test without checking PyPI, check to see if names of local imports matches what we expect

        - Note even though pyflakes isn't in requirements.txt,
          It's added to locals since it is a development dependency for testing
        """
        # should find only docopt and requests
        imports_with_info = pipreqs.get_import_local(self.modules)
        for item in imports_with_info:
            self.assertTrue(item['name'].lower() in self.local)