StackOverflow Questions for Tag: magicmock

ifrj
ifrj

Reputation: 127

How can I use mocking to set each item in a list to whatever I want?

Score: 0

Views: 40

Answers: 0

Read More
ifrj
ifrj

Reputation: 127

How can I mock the return value of a function to be a string, then mock out the return value of an attribute of that function?

Score: 0

Views: 1367

Answers: 1

Read More
Anthony Raterta
Anthony Raterta

Reputation: 1

SQAlchemy .filter does not work when Session is in MagicMock()

Score: 0

Views: 40

Answers: 1

Read More
Vishnuraj
Vishnuraj

Reputation: 21

unittest for decorator in python

Score: 0

Views: 41

Answers: 0

Read More
user3595026
user3595026

Reputation: 629

How to mock SQLAlchemy's limit and offset functions using MagicMock?

Score: 0

Views: 161

Answers: 0

Read More
Brent Hronik
Brent Hronik

Reputation: 2427

Assert mocked function called with json string in python

Score: 8

Views: 3944

Answers: 2

Read More
nerdenator
nerdenator

Reputation: 1307

mock.patch-ing the .append method of the Python list

Score: 0

Views: 545

Answers: 1

Read More
JuanKB1024
JuanKB1024

Reputation: 344

Mock the fetchone() method of the Mysql Cursor class and set its return value to None

Score: 1

Views: 456

Answers: 1

Read More
Marco Mariani
Marco Mariani

Reputation: 107

Python MagicMock how to mock __contains__ method

Score: 0

Views: 612

Answers: 1

Read More
user7692855
user7692855

Reputation: 1428

Mocking an imported function with pytest

Score: 10

Views: 33021

Answers: 3

Read More
Nik
Nik

Reputation: 11

How to add args for mocked functions with MagicMock

Score: 1

Views: 72

Answers: 0

Read More
tlayton
tlayton

Reputation: 13

Monkeypatching `__call__` on MagicMock

Score: 1

Views: 46

Answers: 1

Read More
arrmansa
arrmansa

Reputation: 938

Child Class from MagicMock object has weird spec='str' and can't use or mock methods of the class

Score: 3

Views: 945

Answers: 1

Read More
ApJo
ApJo

Reputation: 183

Mock inner class's attributes using MagicMock

Score: 0

Views: 1193

Answers: 1

Read More
viki
viki

Reputation: 157

pytest - how to mock return a value from two different cursor calls in a method

Score: 0

Views: 1796

Answers: 3

Read More
Lee
Lee

Reputation: 1

How do I mock a method that uses requests.get with the WITH keyword in my class?

Score: 0

Views: 131

Answers: 0

Read More
Jason
Jason

Reputation: 15931

Testing ContextManager, Callable and MagicMock

Score: 0

Views: 136

Answers: 1

Read More
user358829
user358829

Reputation: 761

Python mock() not mocking the return value

Score: 4

Views: 6181

Answers: 2

Read More
TzurEl
TzurEl

Reputation: 862

mock file open in python

Score: 27

Views: 34434

Answers: 2

Read More
Mozgawa
Mozgawa

Reputation: 125

Mocking asynchronous context manager for SQLAlchemy connection

Score: 2

Views: 6463

Answers: 1

Read More
PreviousPage 2Next