Skip to content

Latest commit

 

History

History
44 lines (25 loc) · 1.57 KB

File metadata and controls

44 lines (25 loc) · 1.57 KB

Python Code Reviews

Python Style Guide

CSE developers follow Google's Python Style Guide. Note the use of strong typing throughout. Older versions of python allow you to get away without this but type checking avoids common errors that are tricky to debug.

Linters

CSE projects should check Python code with automated tools. pylint is the minimum, but we prefer to run three different tools:

Pyflakes is a fast static analysis tool that identifies common errors in Python code.

We follow the PEP 8 style guide.

We follow the PEP 257 Docstring conventions.

Flake8 is an option for teams who want a single wrapper for running Pyflakes and pycodestyle.

Unit Testing

Pytest is a simple unit testing framework that provides the basics for unit testing: asserts, fixtures, etc...

pip3 install pytest

Mocking/stubbing framework that works with Pytest. Use this to mock out OS calls, off-box calls, and other calls that would unnecessarily broaden the scope of unit tests.

pip3 install pytest-mock

Starter Code Review Checklist