Unit testing is crucial for software reliability, but Python's dynamic nature poses challenges to unit testing research. This thesis addresses these challenges by leveraging deep learning and large language models to enhance unit testing in Python. Specifically, it (1) automates the generation of assert statements for incomplete test cases, (2) refactors test smells in Python unit tests to improve CI/CD pipeline efficiency, and (3) conducts an empirical study of unit testing practices in open-source Python deep learning projects. This research demonstrates how advanced AI technologies can enhance unit testing quality and ensure the functionality of Python deep learning models.