Course Overview
This 2-day course will help raise the bar from “hacking” with python, to professional-level code you and your peers can maintain.
-
Who should attend
DevOps and QA people with basic knowledge of python. Software developers who want to polish their knowledge of system-level programming, and Automated testing using Python.
-
Prerequisites
Working knowledge of python (2 or 3).
Course Content
-
Setting up Python
- Packaging and Isolation using pip & virtualenv.
- Editing python. Visual Studio Code, pylint.
- Debugging using VSC.
- Coding style and PEP-8.
- Documenting python code using pydoc and doctest.
Writing Tests
- Automating tests and the test pyramid.
- Writing our first test.
- The Setup / Execute / Verify / Teardown pattern.
- Measuring tests coverage.
Using pytest
- pytest vs unittest.
- Test discovery & Structuring unit tests.
- Selective running of test using marks.
- Testing exceptions.
- Python project structure
-
TDD – Test Driven Development
- The Fail-Implement-Pass-Refactor Cycle
- Writing clean tests using pytest Fixtures
Isolating system dependencies
- Dependency injection.
- Mocking.
- Stubbing.
- Patching.
ATDD/BDD
- Writing acceptance criteria.
- Definition of Done.
- Code Reviews.
- Gherkin.
- Automating gherkin test specs using a BDD framework – pytest.BDD.
- Cross-framework tests coverage.