Top "Python-unittest" questions

Python's standard library framework for testing.

How can I simulate input to stdin for pyunit?

I'm trying to test a function that takes input from stdin, which I'm currently testing with something like this: cat /…

python linux python-unittest
How do I make coverage include not tested files?

I have just started writing some unit tests for a python project I have using unittest and coverage. I'm only …

python unit-testing python-unittest coverage.py
ResourceWarning unclosed socket in Python 3 Unit Test

I'm modifying some code to be compatible between Python 2 and Python 3, but have observed a warning in unit test output. /…

python python-3.x sockets python-unittest
Python unittest - Ran 0 tests in 0.000s

So I want to do this code Kata for practice. I want to implement the kata with tdd in separate …

python unit-testing python-unittest python-module
A way to output pyunit test name in setup()

Is there a way in python for a pyunit test to output the test it's currently running. Example: def setUp(…

python unit-testing python-unittest
Python Unit Testing: Automatically Running the Debugger when a test fails

Is there a way to automatically start the debugger at the point at which a unittest fails? Right now I …

python unit-testing pdb python-unittest
Python Mock Patch multiple methods in a class

Im trying to patch multiple methods in a class. Here is my simplified set up Hook.py is defined as …

python python-unittest python-mock
How to use a pandas data frame in a unit test

I am developing a set of python scripts to pre-process a dataset then produce a series of machine learning models …

python pandas python-unittest
Assert an integer is within range

I am writing some unittests in python that are testing if I receive an integer. However sometimes this integer can …

python unit-testing python-2.7 python-unittest
Relative imports with unittest in Python

I am trying to use Python unittest and relative imports, and I can't seem to figure it out. I know …

python python-import python-unittest