About 41 results
https://rednafi.com/go/test-config-with-flags/ · 28 Jun 2025
Control Go test behavior with custom flags instead of build tags or env vars. Enable integration and snapshot tests with discoverable CLI options.
https://rednafi.com/go/di-frameworks-bleh/ · 24 May 2025
Dependency injection in Go doesn't need Dig or Wire. Learn why manual wiring beats reflection magic and how Go's design makes DI frameworks overkill.
https://rednafi.com/go/capture-console-output/ · 12 Apr 2025
Test functions that write to stdout/stderr in Go by capturing output with os.Pipe. Learn patterns to avoid deadlocks in concurrent tests.
https://rednafi.com/go/deferred-teardown-closure/ · 28 Mar 2025
Return teardown closures from test helpers to manage cleanup elegantly. Learn patterns for temp files, mock servers, and t.Cleanup() usage.
https://rednafi.com/go/func-types-and-smis/ · 22 Dec 2024
Implement single-method interfaces with function types instead of structs. Master http.HandlerFunc patterns for middlewares, mocks, and adapters.
https://rednafi.com/python/inject-pytest-fixture/ · 2 Dec 2024
Clean up pytest test signatures using @pytest.mark.usefixtures to inject implicit fixtures without autouse or unused parameter warnings.
https://rednafi.com/python/testing-http-requests/ · 2 Sep 2024
Test HTTP requests in Python with pytest-httpx for full mocking, respx for pattern matching, or VCR.py for recording real responses.
https://rednafi.com/python/pytest-param/ · 28 Aug 2024
Write readable parametrized tests with pytest.param for better test names, conditional skips, custom IDs, and structured test data.
https://rednafi.com/python/patch-pydantic-settings-in-pytest/ · 27 Jan 2024
Mock pydantic_settings in pytest tests by patching the settings class to prevent flaky tests from environment variable dependencies.
https://rednafi.com/python/compose-multiple-levels-of-pytest-fixtures/ · 21 Jul 2022
Combine session and function-scoped pytest fixtures to avoid expensive test setup while maintaining test isolation and preventing state coupling.