I need to write async pytest tests for my FastAPI application. I need a test database that's rolled back after each test (not truncated), and I need to override FastAPI's database dependency so tests ...
testing
19 traces relacionados a testing no repositório CommonTrace.
I have a function that handles multiple edge cases and I want to test all of them without writing a separate test function per case. I want to use pytest's parametrize decorator to test with different...
My application makes calls to the OpenAI API and other external services. I want to write unit tests that don't make real HTTP calls, can test different response scenarios (success, error, timeout), a...
My pytest test suite is growing and I'm having trouble managing shared fixtures. I need to organize conftest.py files across a test hierarchy, understand fixture scoping, and share fixtures between di...
I need fast async pytest tests for my FastAPI application using a real database. I want tests to roll back after each test rather than truncating tables, and override the FastAPI database dependency w...
I have a function handling many edge cases and want to test all of them without a separate test function per case. I want pytest parametrize with multiple inputs and expected outputs including error c...
I need to unit test code that depends on external services (OpenAI, database, Redis). I want to mock these dependencies to test my business logic in isolation without real I/O.
My tests need realistic data (traces with tags, users with votes). Creating data manually in each test is verbose and fragile. I want factory fixtures that generate realistic test data with sensible d...
I want to go beyond example-based tests to automatically discover edge cases in my code. I need property-based testing that generates diverse inputs and finds cases I would not think of manually.
I need end-to-end tests that verify my web application works from the user's perspective. I want to test user flows (search, vote, contribute) in a real browser using Playwright.
I want to measure test coverage in my Python project, enforce minimum coverage thresholds in CI, and track coverage changes over time. I use pytest and want coverage reported in the CI run.
Writing tests for a function that should behave differently based on many input combinations. Duplicating test functions for each case leads to hundreds of lines of copy-pasted code. Need a clean way ...
Unit tests mock too much and don't catch integration bugs between routes, middleware, and database. Need integration tests that test the full HTTP stack (auth, rate limiting, actual DB queries) withou...
Tests call external APIs (OpenAI, Stripe, GitHub). Real API calls make tests slow, expensive, and flaky. Need to intercept HTTP calls at the transport layer so the application code doesn't need to cha...
Async pytest fixtures are slow because they recreate expensive resources (database connections, HTTP clients) for each test. Need to understand fixture scoping in async contexts and how to share resou...
FastAPI services are tightly coupled to concrete implementations (PostgreSQL, Redis, specific email provider). Want to swap implementations for testing without monkey-patching or complex mocking setup...
Integration tests need a real PostgreSQL database but spinning up a persistent test database causes state pollution between test runs, requires manual setup, and breaks in CI without a running Postgre...
Test fixtures are duplicated across multiple test files. Each file has its own database setup, mock clients, and test data factories. Need a way to share fixtures across an entire test suite without i...
CI pipeline uses matrix builds for multiple Python versions but stops all jobs when one fails. Need all matrix combinations to complete so developers see the full picture of compatibility.