---
title: "Discussion on \"Python Testing Part 2: Dependency Inversion with Service Functions\" | Hashnode"
description: "Discussion on \"Python Testing Part 2: Dependency Inversion with Service Functions\". The first article in this series dealt with avoiding excessive use of mocks when testing code that performs I/O.\nThis article deals with service functions that make use of dependency inversion.\nMocks should be absent from these tests altogether. This..."
url: "https://hashnode.com/posts/python-testing-part-2-dependency-inversion-with-service-functions/66ef11f7963e675b98851e01"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python Testing Part 2: Dependency Inversion with Service Functions](https://simoncrowe.hashnode.dev/python-testing-part-2-dependency-inversion-with-service-functions?utm_source=hashnode&utm_medium=feed)

The first article in this series dealt with avoiding excessive use of mocks when testing code that performs I/O. This article deals with service functions that make use of dependency inversion. Mocks should be absent from these tests altogether. This...

Sep 21, 2024 · 4 min read · simoncrowe.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#testing](https://hashnode.com/tag/testing)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)
-   [#software-development](https://hashnode.com/tag/software-development)
-   [#dependency-inversion](https://hashnode.com/tag/dependency-inversion)

## Written by

[Simon Crowe](https://hashnode.com/@simoncrowe)

@simoncrowe · England

  
[View profile](https://hashnode.com/@simoncrowe)

Backend/Cloud Engineer Working with Python, Kubernetes and AWS

I'm a backend engineer currently working in the DevOps space. In addition to cloud-native technologies like Kubernetes, I maintain an active interest in coding, particularly Python, Go and Rust. I started coding over ten years ago with C# and Unity as a hobbyist. Some years later I learned Python and began working as a backend software engineer. This has taken me through several companies and tech stacks and given me a lot of exposure to cloud technologies.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
