Top "Python-unittest" questions

Python's standard library framework for testing.

Custom exceptions in unittests

I have created my custom exceptions as such within errors.py mapper = { 'E101': 'There is no data at all …

python python-3.x unit-testing python-unittest assertraises
How can I write unit tests against code that uses matplotlib?

I'm working on a python (2.7) program that produce a lot of different matplotlib figure (the data are not random). I'm …

python matplotlib python-unittest
Skip unittest if some-condition in SetUpClass fails

I was playing with pyUnit framework for unittest testing of my application. Is there any any way to skip all …

python unit-testing python-3.x python-unittest
Comparing integer to MagicMock not working inside unittest in python

I have a class, which use a class variable to choose which logic to execute. #in file1: class SomeHelper(): def __…

python mocking python-unittest magicmock
Order of tests in python unittest

I was looking at similar questions and I couldn't find an answer to my problem. I wrote Tests in a …

python python-unittest unittest2
How to run Tox with Travis-CI

How do you test different Python versions with Tox from within Travis-CI? I have a tox.ini: [tox] envlist = py{27,33,34,35} …

python unit-testing travis-ci python-unittest tox
How can I convert Python unittests to py.test when having global fixtures?

I do have a set of unit tests written using the Python's unittest module. They are using the setUpModule() function …

python fixtures pytest python-unittest xdist
Is it possible to skip setUp() for a specific test in python's unittest?

When I create a unittest.TestCase, I can define a setUp() function that will run before every test in that …

python unit-testing testing python-unittest
Python Testing how to run parameterised Testcases and pass a parameter to setupClass

I have an python unitest. In the setupClass method I so some timeconsuming tasks... The tests itself run very fast. …

python python-unittest parameterized-unit-test nose-parameterized
unittest - run the same test for a list of inputs and outputs

I have this test import unittest class TestName(unittest.TestCase): def setUp(self): self.name = "Bob" self.expected_name = "Bob" …

python python-unittest