Questions tagged [nosetests]

nosetests is the the script name for running Python [nose] testing, a package for automated unit tests based on simple asserts and running all test*() functions in test*.py.

nosetests is the main script for running tests with automatic discover.

See documentation.

390 questions
0
votes
1 answer

nose tests with custom plugin never enters teardown on assertion errors

I have a selenium test suite run by nose. We have written a custom plugin that pushes info to our db in afterTest() but this returns nothing, so it should not interfere with any of nose's normal functionality. If a test has issues due to timeout…
dbJones
  • 762
  • 1
  • 10
  • 31
0
votes
1 answer

Nose @with_test not working

I have a situation where for some of the tests, I require to use different setup method than I have defined for all, And for this I though to use @with_setup decorator of nose. However this doesn't seem to be working. code: import unittest from…
Gaurang
  • 171
  • 1
  • 14
0
votes
1 answer

Configuring nose tests for different test targets

I have a set of nose tests which I use to test a piece of hardware. For example, the test below is concerned with testing the alarm for each mode on the system: import target modes = ("start","stop","restart","stage1","stage2") max_alarm_time =…
Baz
  • 12,713
  • 38
  • 145
  • 268
0
votes
1 answer

Python Cannot Run NoseTest due to CreateProcess Error 87

I am trying to help someone get setup running nose tests. They are running into an error I have never seen before. A google search seems to be yielding results for Java, but not Python. Below is a screenshot of the error: Any ideas on how to…
DarthOpto
  • 1,640
  • 7
  • 32
  • 59
0
votes
2 answers

Python nosetests: how to access cmd line options? Namely `--failed`

Running: Windows 7, python 3.4 & 2.7 In one of my nosetests plugin, (one that post test data to a website), I need to ascertain if the test is being run with the --failed option or without. If --failed is enabled, that means this test failed the…
AllTradesJack
  • 2,762
  • 5
  • 25
  • 36
0
votes
2 answers

python nose `ValueError: no such test method in : runTest`

I have a working test suite that runs with Nose. I recently realized I needed to add things to my overall setUp(), as triggered by a variable found in each individual test (the variable gets updated by our version control system). I have added an…
dbJones
  • 762
  • 1
  • 10
  • 31
0
votes
1 answer

Detecting if a plugin is loaded in nosetests

I have different code in my tests that needs to execute based on whether or not a plugin is loaded. If the plugin is loaded, it should redirect all the output from the program to a named pipe so the plugin can capture it for logging. If it is not…
JD Russo
  • 422
  • 1
  • 5
  • 9
0
votes
2 answers

Save nosetests results in custom xml file

How do I save nosetests results to a custom xml file located in a specific folder? My directory structure is: /MyApp /TestSuites /Logs My test cases are in a file called tests.py located inside /TestSuites When I try to run: …
areyoufried
  • 51
  • 1
  • 6
0
votes
1 answer

Many python's module error when i try to run nosetests

Why when i run nosetests i will stuck in several errors about python's module for example: ... output = np.polynomial.legendre.leggauss(deg) AttributeError: 'module' object has no attribute…
fronthem
  • 4,011
  • 8
  • 34
  • 55
0
votes
1 answer

How to call built in plugin alongside custom plugin with python nosetests

I am trying to write a custom plugin for nosetests ( a plugin to run as a custom selector) which works fine and i can use it by calling nose.run(plugins=[CustomSelectorPlugin()]) However i also want to run nose with the built-in xunit plugin but I…
Crunchie
  • 197
  • 1
  • 3
  • 9
0
votes
3 answers

nosetests/unittest still shows error when test passes?

I have a unit test that tests if an api point is unaccessible if not authenticated like this: def test_endpoint_get_unauth(self): r = self.get('/api/endpoint/1') self.assertStatusCode(r, 401) The test passes, but nosetests/unittest still…
Patrick Yan
  • 2,338
  • 5
  • 25
  • 33
0
votes
1 answer

Mysterious SyntaxError in nosetest of functions/files

So I'm trying to write a test for part of a word parser function that will basically confirm whether or not the parser will return what it's supposed to. The part I'm writing a test for is a function called "peek" where it takes a list of tuples…
Specterace
  • 1,055
  • 7
  • 7
0
votes
2 answers

Python Nosetests Import Error

I am trying to run my automated tests on Python, and I keep running into an import error. My Directory Hierarchy is as follows: TestingPractice - bin - README.txt - setup.py - TestingPractice - __init__.py - main.py - tests …
0
votes
1 answer

Testing in python

I want to create tests which are dependent on each other. That is the return value of one function (test case) should be used in other testcase. I have tried using unittest and nose tests but unable to have functions which returns values and use…
0
votes
1 answer

./setup.py nosetests error: : Not a directory

I have a package with the following setup.py: from setuptools import find_packages from setuptools import setup # Some dependency_links magic setup( name='dc-gce', version='0.0.1', packages=find_packages(exclude=['tests', 'tests.*']), …
Remco Haszing
  • 7,178
  • 4
  • 40
  • 83