Skip to content Skip to sidebar Skip to footer
Showing posts with the label Pytest

Mock Exception With Side Effect Raised In Class Method And Caught In Calling Method Gives 'did Not Raise'

Using side_effect, I am trying to raise an exception when a mock is called but I get a DID NOT RAIS… Read more Mock Exception With Side Effect Raised In Class Method And Caught In Calling Method Gives 'did Not Raise'

How Can I Test If A Pytest Fixture Raises An Exception?

Use case: In a pytest test suite I have a @fixture which raises exceptions if command line options … Read more How Can I Test If A Pytest Fixture Raises An Exception?

Monkeypatching Not Carrying Through Class Import

I'm trying to test some code using pytest and need to change a function from some module. One o… Read more Monkeypatching Not Carrying Through Class Import

How To Make Pytest Wait For (manual) User Action?

We are sucessfully using pytest (Python 3) to run a test suite testing some hardware devices (elect… Read more How To Make Pytest Wait For (manual) User Action?

Getting Error Typeerror: 'module' Object Has No Attribute '__getitem__'

I am trying to write py.test based test cases. my test.py is !flask/bin/python import pytest impo… Read more Getting Error Typeerror: 'module' Object Has No Attribute '__getitem__'

Pytest Parameterized Test With Custom Id Function

I have a parameterized test which takes str, and dict as an argument and so the name look pretty we… Read more Pytest Parameterized Test With Custom Id Function

Py.test With Xdist Is Not Executing Tests Parametrized With Random Values

Does anybody noticed the following strange behaviour for pytest and xdist. When trying to run the t… Read more Py.test With Xdist Is Not Executing Tests Parametrized With Random Values

Cannot Import Settings In Django

I need to test my Django app with py.test. Hence, I need to tell py.test which is Django's sett… Read more Cannot Import Settings In Django