Maybe I'm not "getting" the philosophy of py.test... I'm trying to re-write a bunch of tests for aws lambda code that receives events (webhooks with json payloa
I've been writing an API and I want to test it. Get requests to API by requests are working well but when I want to test by test_client I have always received
I was reading the Pytest documentation when I noticed a section titled "Grouping multiple tests in a class". There's a paragraph below with a caveat that each t
I know this question has been asked before but i cannot seem to find a solution. This is my folder structure: folder_name/ __init__.py start.py src/
I have it in my project that every python file that has executable python code directly in it, i.e. code that is not encapsulated in a class, will be executed b
I'm trying to write some tests for my FastAPI -application. I have defined app in main.py like this: app = FastAPI(). I try to import this in my test test_api.p
I combine mocking and caching in my code. The mocking is (kind of) random for each pytest as I do not know exactly, what will be returned in the real case. Henc
nas_apps nas_apps -__init__.py -environments.py -settings.py -urls.py -wsgi.py -pytest.ini usecase1 -co
I have an api which is representative of the structure of: from fastapi import FastAPI, Depends, Request, APIRouter class SomeManager: def get_value_from
I have two postgres databases, one for prod and another for testing in "DATABASE_URI" and "TESTDATABASE_URI" respectively. The app seems to working perfectly, w
I have built authentication similar to what is described in the documentation. So I have this dependency copied from there: async def get_current_user(token: st
I have a legacy Django project (django-1.1.29) and some tests in pytest (pytest-4.3.0), all running inside Docker. The database is PostgreSQL 10 and is a docker
I have been trying to parameterize my tests using @pytest.mark.parametrize, and I have a marketer @pytest.mark.test("1234"), I use the value from the test marke
I'm trying to create a test with pytest and moto that check if the StackStatus from the dictionary returned from the function list_stacks() (https://boto3.amaz
I have a project structure like this: setup.cfg integration_tests/ |----tests.py src/ |----manage.py |----my_django_app/ And a setup.cfg with this: [t
I'm attempting to test a a method that is memoized through lru_cache (since it's an expensive database call). with pytest-mock. A simplified version of the cod
I have a piece of code that generates a report and adds a screenshot to it when test fails: def pytest_runtest_makereport(item): pytest_html = item.config.plugi
I am very new to python and this is probably something trivial. I have the following test: import pytest from pytest_mock import MockerFixture, call # Create e
I see from here that I can pick out tests based on their mark like so: pytest -v -m webtest Let's say I have a test decorated like so: @pytest.mark.parametr
I am using Pytest framwork for testing a web applications. While the tests run, it generates data and store them into variables. Example: @pytest.mark.usefixt