How to use the proselint.command_line._delete_compiled_python_files function in proselint

To help you get started, we’ve selected a few proselint 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 amperser / proselint / tests / test_clear_cache.py View on Github external
def test_no_permission(self, mock_remove, mock_walk):
        """Ignore if unable to delete files."""
        mock_walk.return_value = self.files
        cl._delete_compiled_python_files()
github amperser / proselint / tests / test_clear_cache.py View on Github external
def test__remove_dir(self, mock_remove, mock_walk):
        """Ignore if attempt to delete a directory."""
        mock_walk.return_value = self.files
        cl._delete_compiled_python_files()
github amperser / proselint / tests / test_clear_cache.py View on Github external
def test_files_not_found(self, mock_remove, mock_walk):
        """Ignore if file not found."""
        mock_walk.return_value = self.files
        cl._delete_compiled_python_files()
github amperser / proselint / tests / test_clear_cache.py View on Github external
def test_delete_pyc_file(self, mock_remove, mock_walk):
        """Ensure 'pyc' files are removed."""
        mock_walk.return_value = self.files

        cl._delete_compiled_python_files()
        mock_remove.assert_called_with(self.pyc_file_path)
github amperser / proselint / tests / test_clear_cache.py View on Github external
def test_on_oserror(self, mock_remove, mock_walk):
        """Ignore if OSError."""
        mock_walk.return_value = self.files
        cl._delete_compiled_python_files()
github amperser / proselint / tests / test_clear_cache.py View on Github external
def test_files_not_deleted(self, mock_remove, mock_walk):
        """Ensure non 'pyc' files are not removed."""
        mock_walk.return_value = self.files
        cl._delete_compiled_python_files()

        with self.assertRaises(AssertionError):
            mock_remove.assert_called_with(self.python_file_path)

        with self.assertRaises(AssertionError):
            mock_remove.assert_called_with(self.dot_pyc_path)