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

Why A Fatal Python Error When Testing Using Pytest-qt?

My first test using pytest-qt failed immediately with a Fatal Python error. I reduced the code to … Read more Why A Fatal Python Error When Testing Using Pytest-qt?

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

How To Avoid Decorators While Unit Testing In Python Flask Application

I am new to python and flask. I wanted to create unit tests for an api written. We have used jwt fo… Read more How To Avoid Decorators While Unit Testing In Python Flask Application

Report Number Of Assertions In Pytest

I am using pytest for writing some tests at integration level. I would like to be able to also repo… Read more Report Number Of Assertions In Pytest

Test Database Not Keeping Data During Django Channels Pytest Test

I'm writing tests for a Django Channels application following the documentation. I can successf… Read more Test Database Not Keeping Data During Django Channels Pytest Test

Setting Command Line Arguments For Main Function Tests

I have a main() function in python that gets command line arguments. Is there a way for me to write… Read more Setting Command Line Arguments For Main Function Tests

Pytest Parameters Execution Order For Repeated Test Seems To Be Wrong

I am trying to run a test repeatedly which is a paramertrized. it doesn't seem to follow the or… Read more Pytest Parameters Execution Order For Repeated Test Seems To Be Wrong

Repeat A Test Upon An Assertionerror

There is the module pytest-repeat which can be used to repeat the execution of pytest N times (the … Read more Repeat A Test Upon An Assertionerror

Run Trace.py With Pytest

I'm trying to get coverage using trace.py when running pytest. I know that pytest has its own c… Read more Run Trace.py With Pytest

Fatal Python Error When Running Pytest With Qt

I'm new to pytest and I'm having trouble trying to run one of my test files. I'm getti… Read more Fatal Python Error When Running Pytest With Qt

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])

Use Ipdb Instead Of Pdb With Py.test --pdb Option

I want to use ipdb instead of pdb with py.test --pdb option. Is this possible? If so, how? Clearly,… Read more Use Ipdb Instead Of Pdb With Py.test --pdb Option

Test If Code Is Executed From Within A Py.test Session

I'd like to connect to a different database if my code is running under py.test. Is there a fu… Read more Test If Code Is Executed From Within A Py.test Session

How To Click On Qmessagebox With Pytest-qt?

I am creating some unit tests for a PyQt application with pytest-qt. And I would like to create ope… Read more How To Click On Qmessagebox With Pytest-qt?

Transitive Import Error: Modulenotfounderror: No Module Named '...'

I'm confused now. Here is the project tree: project - source - - lib - - - __init__.py - - - u… Read more Transitive Import Error: Modulenotfounderror: No Module Named '...'

Py.test Logging Control

We have recently switched to py.test for python testing (which is fantastic btw). However, I'm … Read more Py.test Logging Control

Empty Messages In Caplog When Logs Emmited In A Different Process

I am running the test with log_cli=true. The script: import logging import sys from multiprocessing… Read more Empty Messages In Caplog When Logs Emmited In A Different Process

Pytest Skip Everything If One Test Fails

What is best way to skip every remaining test if a specific test fails, here test_002_wips_online.p… Read more Pytest Skip Everything If One Test Fails

How To Clear Captured Stdout/stderr In Between Of Multiple Assert Statements

I have some tests with assertions in loop, each assertion is kinda like separate test and I don… Read more How To Clear Captured Stdout/stderr In Between Of Multiple Assert Statements

Supply An Array Full With Objects As Argument To Another Class And Receive Back The Corrected

I want to do this. I have a class (MyInputs) where I will initialize the inputs. I will have a nump… Read more Supply An Array Full With Objects As Argument To Another Class And Receive Back The Corrected