Questions tagged [nose]

Nose is an alternate Python unittest discovery and running process. It is intended to mimic the behavior of py.test as much as is reasonably possible.

Nose is an alternate unittest discovery and running process. It is intended to mimic the behavior of py.test as much as is reasonably possible.

Resources

1036 questions
63
votes
3 answers

`python -m unittest discover` does not discover tests

Python's unittest discover does not find my tests! I have been using nose to discover my unit tests and it is working fine. From the top level of my project, if I run nosetests I get: Ran 31 tests in 0.390s Now that Python 2.7 unittest has…
blokeley
  • 6,726
  • 9
  • 53
  • 75
57
votes
7 answers

Nose unable to find tests in ubuntu

Is there any reason why Nose wouldn't be able to find tests in Ubuntu 9.04? I'm using nose 0.11.1 with python 2.5.4. I can run tests only if I explicitly specify the filename. If I don't specify the filename it just says, 0 tests. The same…
Sudhir Jonathan
  • 16,998
  • 13
  • 66
  • 90
56
votes
16 answers

How to automatically run tests when there's any change in my project (Django)?

At the moment I am running python manage.py test every once in a while after I make significant changes in my django project. Is it possible to run those tests automatically whenever I change and save a file in my project? It'll be useful to detect…
user1011444
  • 1,389
  • 2
  • 15
  • 25
48
votes
8 answers

ModuleNotFoundError: No module named 'numpy.testing.nosetester'

I was using the Decision Tree and this error was raised. The same situation appeared when I used Back Propagation. How can I solve it? import pandas as pd import numpy as np a = np.test() f = open('E:/lgdata.csv') data = pd.read_csv(f,index_col =…
jiuseki
  • 581
  • 1
  • 4
  • 3
47
votes
9 answers

Problems using nose in a virtualenv

I am unable to use nose (nosetests) in a virtualenv project - it can't seem to find the packages installed in the virtualenv environment. The odd thing is that i can set test_suite = 'nose.collector' in setup.py and run the tests just fine…
Ryan
  • 1,306
  • 1
  • 13
  • 20
43
votes
3 answers

List all Tests Found by Nosetest

I use nosetests to run my unittests and it works well. I want to get a list of all the tests nostests finds without actually running them. Is there a way to do that?
Cristian
  • 42,563
  • 25
  • 88
  • 99
36
votes
6 answers

How should we test exceptions with nose?

I'm testing exceptions with nose. Here's an example: def testDeleteUserUserNotFound(self): "Test exception is raised when trying to delete non-existent users" try: self.client.deleteUser('10000001-0000-0000-1000-100000000000') …
BartD
  • 567
  • 1
  • 6
  • 10
34
votes
10 answers

Installing nose using pip, but bash doesn't recognize command on mac

I'm trying to install nose on my computer for the Learn Python the Hard Way tutorial, but can't seem to get it to work. I'm using pip to install: $ pip install nose And I get back: Requirement already satisfied (use --upgrade to upgrade): nose in…
Zubin
  • 393
  • 1
  • 3
  • 7
33
votes
3 answers

How to suppress verbose Tensorflow logging?

I'm unittesting my Tensorflow code with nosetests but it produces such amount of verbose output that makes it useless. The following test import unittest import tensorflow as tf class MyTest(unittest.TestCase): def test_creation(self): …
tonicebrian
  • 4,715
  • 5
  • 41
  • 65
32
votes
1 answer

Python unitest - Use variables defined in module and class level setup functions, in tests

I am doing Python unit testing using nosetests to experiment with Python class and module fixtures, to have minimal setup across my tests. The problem is I am not sure how to use any variables defined in the setupUpModule and the setUpClass…
Amey
  • 8,470
  • 9
  • 44
  • 63
31
votes
1 answer

How can I have nose re-run only tests that failed?

I have some Selenium Webdriver GUI tests that run on every check-in in our Trac/Bitten build environment. For various silly reasons, these are fragile and re-running the failed test always works (unless it doesn't, and then I have an actually…
stvsmth
  • 3,578
  • 2
  • 28
  • 30
30
votes
3 answers

How do you run nosetest from pycharm?

How do you execute nosetest from pycharm to run all unit tests? I know that pycharm supports python's unittest and py.test and that they will properly support nosetests in pycharm 1.1 but I was wondering if there was a work around.
Nick Sonneveld
  • 3,356
  • 6
  • 39
  • 48
30
votes
4 answers

How to make nosetests use python3

I try to use nosetests ❯ nosetests '/pathTo/test' but it uses python 2.7 for my tests: sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0) So some of them fails, because they were written in python 3.3. I work it around…
Maxim Yefremov
  • 13,671
  • 27
  • 117
  • 166
30
votes
3 answers

How to exclude mock package from python coverage report using nosetests

I currently try to use the mock library to write some basic nose unittests in python. After finishing some basic example I now tried to use nosetests --with-coverage and now I have the mock package and the package I tried to 'mock away' are shown in…
Frederick Roth
  • 2,748
  • 4
  • 28
  • 42
28
votes
2 answers

Make nose test runner show logging even if tests pass

I am using nosetests test.py to run unit tests: import unittest import logging class Test(unittest.TestCase): def test_pass(self): logging.getLogger('do_not_want').info('HIDE THIS') logging.getLogger('test').info('TEST PASS') …
Fenikso
  • 9,251
  • 5
  • 44
  • 72
1
2
3
69 70