Skip to main content

Python Mocking Guide: External Dependencies, Test Doubles, and Pytest Best Practices

· 9 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

External dependencies are a major source of pain in unit testing. Network calls, persistent databases, and file systems are inherently slow, non-deterministic, and prone to environmental failures. Mocking these boundaries isolates your unit tests and delivers sub-second test execution suites.

However, over-mocking leads to brittle tests that pass while production code breaks. This guide provides a complete manual on Python test doubles: the architectural framework of when to mock, test double taxonomy (stubs, fakes, spies, mocks), hands-on unittest.mock examples for HTTP APIs, databases, and file systems, plus Pytest mocking pitfalls to avoid.

N8n, Make, or Zapier: Complete Comparison Guide, Features, and Pricing

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Choosing the right workflow automation platform is a critical business decision that impacts everything from efficiency and cost to data security and technical control. There is no single "best" platform; the final verdict depends entirely on your specific use case, technical skills, and budget [1, 2].

N8n vs. Make (formerly Integromat)

· 8 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

n8n and Make (formerly Integromat) are two of the most powerful workflow automation platforms available, but they have fundamentally different approaches. While both allow you to build complex automations with a visual interface, they cater to different users and use cases. Choosing between them comes down to a trade-off between accessibility and raw technical power [1].

N8n for AI and LLM automations

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

As the automation landscape evolves, the integration of Artificial Intelligence (AI) and Large Language Models (LLMs) into workflows has become a game-changer. n8n is particularly well-suited for this, thanks to its open, flexible architecture that allows you to connect AI services to virtually any other tool in your stack [2]. This article will explore how to leverage n8n for AI and LLM automations, providing practical examples and use cases.

Foundation for building production-ready n8n automations

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

For mission-critical automations, simply creating a workflow is not enough. To ensure your n8n workflows are reliable, scalable, and secure, you must implement proper error handling, leverage custom code for advanced logic, and choose a robust deployment strategy. This article will cover these critical topics, setting the foundation for building production-ready n8n automations.

N8N: creating your first complex automation

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

At its core, n8n uses a node-based workflow system. Think of a workflow as a visual flowchart. Each step in the automation is represented by a node, and these nodes are connected to each other to define the flow of data [1]. Data flows from the output of one node to the input of the next, allowing you to build complex logic visually.

Each node performs a specific task, like:

  • Triggers: The starting point of a workflow. This could be a webhook, a scheduled time, or an event in an external app.
  • Actions: The workhorse nodes that perform an action, such as sending an email, creating a record in a database, or uploading a file.
  • Logic: Nodes that control the flow, like a conditional IF statement, a loop, or a data transformation node.

The ability to chain these nodes together is what gives n8n its immense flexibility.

Given-When-Then vs. Alternative Python Test Structuring Patterns

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

For docstrings in Python tests, there isn't a single technique that's universally "better" than Given-When-Then. The best technique depends on your project's needs, your team's familiarity with different styles, and the specific type of testing you're doing.

Supabase Pitfalls: Avoid These Common Mistakes for a Robust Backend

· 13 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Supabase Pitfalls: Avoid These Common Mistakes for a Robust Backend

Supabase offers a powerful open-source alternative to Firebase, built around PostgreSQL. Its ease of use makes it a favorite for rapid development, but this very convenience can lead developers down paths that introduce technical debt, performance bottlenecks, and security vulnerabilities. Understanding and avoiding these common pitfalls is crucial for building a robust and scalable application.

Regex for searches in VSCode

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Visual Studio Code (VS Code) provides a powerful, built-in regex engine for its Find and Search functions. This feature allows you to perform highly specific and complex searches and replacements across a single file or an entire project.

Benchmark & Architecture Guide: msgspec vs. Pydantic v2

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

High-throughput Python microservices, data ingestion pipelines, and web APIs frequently bottleneck on serialization and data validation. While Pydantic v2 (re-written with a Rust core) revolutionized Python data validation, msgspec offers extreme performance advantages for specialized data workloads.

This guide provides a comprehensive benchmark analysis and architectural breakdown comparing msgspec and Pydantic v2, detailing throughput metrics, validation mechanics, ecosystem trade-offs, and selection criteria.

Looking for more content?
Hrekov Blog contains 165 articles. Browse the blog archive or Explore the full timeline.