Skip to content Skip to sidebar Skip to footer
Showing posts with the label Python Unittest

Concurrency Issue With Psycopg2, Redshift, And Unittest

I am in Python 2.7, using psycopg2 to connect to an Amazon Redshift database. I have unit tests, an… Read more Concurrency Issue With Psycopg2, Redshift, And Unittest

How To Permanently Mock Return Value Of A Function In Python Unittest

I have a function # foo.py NUM_SHARDS = 10 def get_shard(shard_key: int) -> int return (shar… Read more How To Permanently Mock Return Value Of A Function In Python Unittest

Is Test Suite Deprecated In Pyunit?

Following the example in PyUnit, I came up with the following unittest code that works fine. impor… Read more Is Test Suite Deprecated In Pyunit?

No Active Exception To Reraise

A brief background first. I have to run some unit tests. Only issue is that the client wants the fa… Read more No Active Exception To Reraise

Stop Unittest From Running Code From Import Module

Got 2 files : new_project ├── Main.py └── testing.py I run: $ cd new_project $ python -m unittest… Read more Stop Unittest From Running Code From Import Module

Recursive Unittest Discovery With Python3 And Without __init__.py Files

I have project with the following directory structure: . ├── requirements.txt ├── main.py ├── tests… Read more Recursive Unittest Discovery With Python3 And Without __init__.py Files