Skip to content Skip to sidebar Skip to footer
Showing posts with the label Unit Testing

Automating Unit Testing In Pyqt5 Using Gitlab's Ci: Qxcbconnection Error

I am creating a GUI skeleton (for now) using PyQt5 and I have written some unit tests (using Python… Read more Automating Unit Testing In Pyqt5 Using Gitlab's Ci: Qxcbconnection Error

How To Keep Unit Tests And Integrations Tests Separate In Pytest

According to Wikipedia and various articles it is best practice to divide tests into Unit tests (ru… Read more How To Keep Unit Tests And Integrations Tests Separate In Pytest

Define A Pytest Fixture Providing Multiple Arguments To Test Function

With pytest, I can define a fixture like so: @pytest.fixture def foo(): return 'blah' … Read more Define A Pytest Fixture Providing Multiple Arguments To Test Function

How To Locally Unit Test Python 3 App Engine Application?

I have testbed setup locally to test python2.7 based app engine application. As part of the python3… Read more How To Locally Unit Test Python 3 App Engine Application?

Testing Python Scripts

How do I test the STDOUT output of a Python script with a testing framework like doctest, unittest,… Read more Testing Python Scripts

Executing Single Unittest Over A Sequence In Python

I have the unittest that may run over some sequence, where I check results of some processing over … Read more Executing Single Unittest Over A Sequence In Python

Mock A Pyqt Method

I have an existing class which inherits from the PyQT5 classes QWidget and Ui_Dialog. I want to use… Read more Mock A Pyqt Method

Mock Open() Function Used In A Class Method

I tried to mock the open function used in a method of my class. I found this thread How do I mock a… Read more Mock Open() Function Used In A Class Method

Tools To Coverage Tests Django Rest Framework

I am studying TDD and developing an API in Django Rest Framework, and I had a need that I researche… Read more Tools To Coverage Tests Django Rest Framework

How To Patch The Python 3 Breakpoint() Builtin?

I wrote a decorator that halts my program with breakpoint() if a critical error happens. def the_br… Read more How To Patch The Python 3 Breakpoint() Builtin?

Running Unit Tests In Parallel With Pytest?

How can I parallelize the execution of the unit tests written with pytest? Which tactics of paralle… Read more Running Unit Tests In Parallel With Pytest?

Pycharm Unittests Only Work Individually

I can run my test cases individually by right-clicking them and selecting Run 'Unittests in tes… Read more Pycharm Unittests Only Work Individually

Nose, Unittest.testcase And Metaclass: Auto-generated Test_* Methods Not Discovered

This is a follow-up question for unittest and metaclass: automatic test_* method generation: For th… Read more Nose, Unittest.testcase And Metaclass: Auto-generated Test_* Methods Not Discovered

How To Mock Python's Datetime.now() In A Class Method For Unit Testing?

I'm trying to write tests for a class that has methods like: import datetime import pytz class… Read more How To Mock Python's Datetime.now() In A Class Method For Unit Testing?

(unit) Test Python Signal Handler

I have a simple Python service, where there is a loop that performs some action infinitely. On vari… Read more (unit) Test Python Signal Handler

Test Framework For Testing Embedded Systems In Python

I would like to test the features of an embedded device. To simplify I can say it is an humanoid ro… Read more Test Framework For Testing Embedded Systems In Python

Mocking Grpc Status Code ('rpcerror' Object Has No Attribute 'code') In Flask App

I have to create a unittest that should mock a specific grpc status code (in my case I need NOT_FOU… Read more Mocking Grpc Status Code ('rpcerror' Object Has No Attribute 'code') In Flask App

How Can I Unit Test Django Messages?

In my django application, I'm trying to write a unit test that performs an action and then chec… Read more How Can I Unit Test Django Messages?

How To Call A Compiled Function Body?

When I get hold of a code object (via internals like .func_code or __code__ in Python 3), is there … Read more How To Call A Compiled Function Body?

How Can I Unittest Whether Pdf Files Have Been Generated Correctly?

I write a small python library that uses matplotlib and seaborn to draw charts, and I wonder how I … Read more How Can I Unittest Whether Pdf Files Have Been Generated Correctly?