Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about pytest-asyncio

Read more about pytest-asyncio

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - pytest-asyncio

How do I add an attribute to AsyncMock?

Code: class SomeClass(BaseClass): async def async_method(arg1, arg2, **kwargs): await self.foo.bar(arg1=arg1, arg2=arg2).baz(**kwargs) One of the tests used: @pytest.fixture def same_cla...
test-img

Maksim

python

pytest

python-asyncio

pytest-asyncio

Votes: 0

Answers: 1

Latest Answer

From the AsyncMock documentation The AsyncMock object will behave so the object is recognized as an async function, and the result of a call is an awaitable. In your code, bar is the async function ...
test-img

dirn

How to call an async function in pytest_sessionfinish()?

I am using pytest-asyncio. I have the following conftest.py file: import asyncio import pytest from database.mongo_db import mongo @pytest.fixture(scope="session", autouse=True) async def...
test-img

KOB

python

asynchronous

pytest

python-asyncio

pytest-asyncio

Votes: 0

Answers: 1

Latest Answer

Don't. Pytests manages the event loop and you shouldn't (and needn't) interfere with that. [EDIT: Ok, sorry. Interfere, if you have to... For example to extend the scope of the event_loop fixture.] ...
test-img

thisisalsomypassword

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved