StackOverflow Questions for Tag: contextmanager

Kumar Gaurav
Kumar Gaurav

Reputation: 21

Testing async context manager fixture in pytest yields unexpected async generator object

Score: 2

Views: 271

Answers: 1

Read More
Miguel
Miguel

Reputation: 9

How to temporarily change a class object?

Score: 0

Views: 47

Answers: 1

Read More
Leon0402
Leon0402

Reputation: 298

Context managers as attributes

Score: 1

Views: 67

Answers: 0

Read More
HISI
HISI

Reputation: 4797

One-line syntax to read and return file on Python using with

Score: -2

Views: 593

Answers: 2

Read More
Michiel Karrenbelt
Michiel Karrenbelt

Reputation: 143

Python context manager that backs up and restores `cwd` leaves terminal in erroneous state

Score: 1

Views: 53

Answers: 1

Read More
Cobalt Rimbo
Cobalt Rimbo

Reputation: 13

How to extend the lifespan of an object under asynccontextmanager into a background task in FastAPI?

Score: 1

Views: 171

Answers: 2

Read More
Carl Thomé
Carl Thomé

Reputation: 2742

Use context manager in lambda, how?

Score: 7

Views: 2263

Answers: 3

Read More
Recursing
Recursing

Reputation: 648

Async Context Manager that performs an action on context switch

Score: 2

Views: 856

Answers: 2

Read More
Chris Rutherford
Chris Rutherford

Reputation: 1

How can I mock multiple context managers and function calls with pytest in async contexts?

Score: 0

Views: 16

Answers: 0

Read More
user444997
user444997

Reputation: 323

Understanding the Python with statement and context managers

Score: 32

Views: 18192

Answers: 6

Read More
JamesThomasMoon
JamesThomasMoon

Reputation: 7124

logger.exception during context-manager __exit__

Score: -2

Views: 34

Answers: 2

Read More
Romanin
Romanin

Reputation: 11

How to make dynamic widgets in DearPyGUI?

Score: 0

Views: 211

Answers: 1

Read More
Callum
Callum

Reputation: 321

Using a context manager with mysql connector python

Score: 9

Views: 9500

Answers: 3

Read More
Danny Staple
Danny Staple

Reputation: 7312

In python, is there a good idiom for using context managers in setup/teardown

Score: 75

Views: 20068

Answers: 6

Read More
Yuxuan Zhang
Yuxuan Zhang

Reputation: 43

Dealing with interlacing lock in Python3

Score: 3

Views: 221

Answers: 3

Read More
nonbot
nonbot

Reputation: 973

Context Managers as a class vs. function?

Score: 6

Views: 6062

Answers: 3

Read More
crm5024
crm5024

Reputation: 1

How do I use an asyncio context manager with Jupyter notebooks to create new tasks?

Score: 0

Views: 51

Answers: 0

Read More
Eric Grunzke
Eric Grunzke

Reputation: 1647

What is the proper way to type hint the return value of an @asynccontextmanager?

Score: 15

Views: 9098

Answers: 1

Read More
Ron Serruya
Ron Serruya

Reputation: 4426

How can I wait for an object's __del__ to finish before the async loop closes?

Score: 29

Views: 11097

Answers: 6

Read More
Keith Lee
Keith Lee

Reputation: 1

Mocked database cursor context manager missing the '__enter__'

Score: 0

Views: 36

Answers: 1

Read More
PreviousPage 1Next