Skip to content

Instantly share code, notes, and snippets.

@mahmoodkhan
mahmoodkhan / dependency_injection.py
Created February 28, 2021 01:36
Dependency Injection in Python 3 with Testing
# Dependency Injection in Python 3 with Testing
class MessageFormatter:
def success(self, message):
return f"👍 {message}"
class MessageWriter:
def __init__(self):
self.message_formatter = MessageFormatter()