Questions tagged [python-nose]

Nose is an alternate Python unittest collecting and running tool.

Nose is an alternate Python unittest collecting and running tool.

Quote from nose pypi page:

It extends the test loading and running features of unittest, making it easier to write, find and run tests.

Nose is easily customizeable via plugins. It also has a number of builtin plugins out of the box.

7 questions
17
votes
5 answers

How to organize python test in a way that I can run all tests in a single command?

Currently my code is organized in the following tree structure: src/ module1.py module2.py test_module1.py test_module2.py subpackage1/ __init__.py moduleA.py moduleB.py test_moduleA.py …
Andrea Francia
  • 9,737
  • 16
  • 56
  • 70
7
votes
1 answer

testing python multiprocessing pool code with nose

I am trying to write tests with nose that get set up with something calculated using multiprocessing. I have this directory structure: code/ tests/ tests.py tests.py looks like this: import multiprocessing as mp def f(i): return i…
aaren
  • 5,325
  • 6
  • 29
  • 24
2
votes
1 answer

The six module is causing problems with test coverage using nosetests

I'm using nosetests and the coverage extension to measure the coverage of my unit tests. I've recently moved to including the six module with my package to make it easier for users. The problem is that having six locally seems to mess up the…
mwaskom
  • 46,693
  • 16
  • 125
  • 127
2
votes
2 answers

Run doctest plugin with nose.main

I would like to run the Nose builtin Doctest plugin from within Python, notably without command line options or environment variables. One would expect the following to work: import nose, os from nose.plugins.builtin import Doctest # or from…
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
1
vote
1 answer

Run multiprocess

I'm trying to run tests in parallel using nose. I have setup a nose.cfg file to contain the following: [nosetests] verbosity=2 processes=2 I need to be able to run the programatically using either nose.main() or nose.run(). Whats the best way to do…
tallowen
  • 4,198
  • 7
  • 27
  • 35
1
vote
1 answer

python-nose: how to trigger a custom callback on test failure

I am using python-nose to run some tests. The test code is arranged into modules, where each module's fixtures install some VMs in a new configuration, and the module's tests then check the behaviour of those VMs is what is expected. I want to…
Alex Zeffertt
  • 1,462
  • 11
  • 12
0
votes
2 answers

How to run tests in order of their appearance in test script using nose?

I want run my tests in order of they are written not in alphabetical order that unittest does by default. import unittest class test2(unittest.TestCase): def test1(self): pass def test0(self): pass class…
Mahsa Mortazavi
  • 755
  • 3
  • 7
  • 23