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

Pytest Modulenotfounderror

Even for as long as I've worked in Python, I still occasionally run into issues with my package… Read more Pytest Modulenotfounderror

Test Calling Of An External Script Run Via Popen That Expects No Available Data In Stdin Using Pytest

I have an external tool with a command line interface that checks whether any data is provided via … Read more Test Calling Of An External Script Run Via Popen That Expects No Available Data In Stdin Using Pytest

Importerror Shows Up With Py.test, But Not When Running The App

Unlike in this question: Importing modules from a sibling directory for use with py.test I can impo… Read more Importerror Shows Up With Py.test, But Not When Running The App

Py.test Does Not Start (ebusy: [resource Device])

Just installed py.test with pip install -U pytest with no errors, however we I'm trying to laun… Read more Py.test Does Not Start (ebusy: [resource Device])

Provide Default Argument Value For Py.test Fixture Function

Is there a better way for me to provide default value for argument pytest.fixture function? I have… Read more Provide Default Argument Value For Py.test Fixture Function

Py.test Passing Results Of One Test To Another

Currently I have test looking like this: @pytest.mark.parametrize('param', [1,2,3]) def tes… Read more Py.test Passing Results Of One Test To Another

Py.test -n => "py.test: Error: Unrecognized Arguments: -n"

I am trying to distribute django tests to multiple processes to speed up test runs. I am using py.t… Read more Py.test -n => "py.test: Error: Unrecognized Arguments: -n"

Mock A Class With Tedious __init__

I have a class that actually connects to a service and does authentication and stuff, but all of th… Read more Mock A Class With Tedious __init__

How To Remove A Library With Monkeypatch Or Mock In Pytest?

If my library has a contrib extra that has dependencies in it (say requests) that I want users to h… Read more How To Remove A Library With Monkeypatch Or Mock In Pytest?

Error After Installation Of Allure Pytest Adaptor

I am trying to configure Allure (2.6.0) with Pytest (3.6xx) on a Windows 8 box. I am able to run p… Read more Error After Installation Of Allure Pytest Adaptor

Pytest - How Can I Pass Pytest Addoption Value To Pytest Parameterize?

I have to to pass an argument in my pytest command which I am storing in pytest addoption. I want t… Read more Pytest - How Can I Pass Pytest Addoption Value To Pytest Parameterize?

Getting A "can't Pickle Local Object 'liveservertestcase'" Error When Trying To Use Liveservertestcase To Test Flask App

I am getting the error mentioned in the title once trying to run a unittest on my Flask app using L… Read more Getting A "can't Pickle Local Object 'liveservertestcase'" Error When Trying To Use Liveservertestcase To Test Flask App

Pytest Cannot Find Module On Import But Code Runs Just Fine

The goal is to use the pytest unit test framework for a Python3 project that uses Cython. This is n… Read more Pytest Cannot Find Module On Import But Code Runs Just Fine

Pytest Teardown_class Is Being Run Too Soon

The Python 'teardown_class' is not behaving as I expect it to. Below is a summary of my cod… Read more Pytest Teardown_class Is Being Run Too Soon

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

How Can Request.param Be Annotated In Indirect Parametrization?

In the Indirect parametrization example I want to type hint request.param indicating a specific typ… Read more How Can Request.param Be Annotated In Indirect Parametrization?

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

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 Access Al The Markers In A Pytest Fixture?

I'm using pytest and I want to tag my tests with markers which will specify to a fixture which … Read more How Can I Access Al The Markers In A Pytest Fixture?

How To Keep Track Of Instances Of Python Objects In A Reliable Way?

I would like to be able to keep track of instances of geometric Point objects in order to know what… Read more How To Keep Track Of Instances Of Python Objects In A Reliable Way?