nosetests

pydev nosetests test run

房东的猫 提交于 2019-12-06 05:35:31
问题 Seems like a silly question but I've been unable to figure it out... I'd like to use eclipse/pyunit to run all my tests. I've configured the test runner to be the nose test runner. Now I'd like for pyunit to use nose 回答1: You can right-click a folder/file and choose Run as > Python unittest or if you have the file open in an editor, you can use 'Ctrl+F9' to run the tests (and even filter to select the test(s) you want to run). Note: for this to work with nose you have to select the nose test

python nosetests setting the test description

你离开我真会死。 提交于 2019-12-05 22:47:17
I'm creating tests on the fly (I must) in python to run with nosetests as below: def my_verification_method(param): """ description """ assert param>0, "something bad..." def test_apps(): """ make tests on the fly """ param1 = 1 my_verification_method.__doc__ = "test with param=%i" % param1 yield my_verification_method, param1 param1 = 2 my_verification_method.__doc__ = "test with param=%i" % param1 yield my_verification_method, param1 The problem is that that nosetest prints: make tests on the fly ... ok make tests on the fly ... ok which is not what I want. I want the output of nosetests say

Getting tests to parallelize using nose in python

你。 提交于 2019-12-05 06:28:00
I have a directory with lots of .py files (say test_1.py, test_2.py and so on) Each one of them is written properly to be used with nose. So when I run nosetests script, it finds all the tests in all the .py files and executes them. I now want to parallelize them so that all the tests in all .py files are treated as being parallelizable and delegated to worker processes. It seems that by default, doing : nosetests --processes=2 introduces no parallelism at all and all tests across all .py files still run in just one process I tried putting a _multiprocess_can_split_ = True in each of the .py

Handling Exceptions in Python Behave Testing framework

依然范特西╮ 提交于 2019-12-05 03:45:40
I've been thinking about switching from nose to behave for testing (mocha/chai etc have spoiled me). So far so good, but I can't seem to figure out any way of testing for exceptions besides: @then("It throws a KeyError exception") def step_impl(context): try: konfigure.load_env_mapping("baz", context.configs) except KeyError, e: assert (e.message == "No baz configuration found") With nose I can annotate a test with @raises(KeyError) I can't find anything like this in behave (not in the source, not in the examples, not here). It sure would be grand to be able to specify exceptions that might be

How to output coverage XML with nosetests?

两盒软妹~` 提交于 2019-12-05 01:03:55
I'm trying to output the coverage XML of my nosetests so they show up on Hudson. The line I'm executing is: nosetests --with-gae -v --all-modules --with-xunit --with-coverage I see the coverage output in the console, but there's no xml file containing the coverage data. How can I get it to output the coverage xml? Once you've run the nosetests command, there will be a .coverage data file in the directory. If you then run coverage xml , it will create a Cobertura-compatible XML file from the .coverage file. Jeremy Cunningham There is a plugin written for nosetests to do just this. You just have

pydev nosetests test run

∥☆過路亽.° 提交于 2019-12-04 10:06:40
Seems like a silly question but I've been unable to figure it out... I'd like to use eclipse/pyunit to run all my tests. I've configured the test runner to be the nose test runner. Now I'd like for pyunit to use nose You can right-click a folder/file and choose Run as > Python unittest or if you have the file open in an editor, you can use 'Ctrl+F9' to run the tests (and even filter to select the test(s) you want to run). Note: for this to work with nose you have to select the nose test runner in the preferences (window > preferences > pydev > pyunit) -- and the same is true if you're using

How do I run a single test with Nose in Pylons

醉酒当歌 提交于 2019-12-04 07:27:31
问题 I have a Pylons 1.0 app with a bunch of tests in the test/functional directory. I'm getting weird test results and I want to just run a single test. The nose documentation says I should be able to pass in a test name at the command line but I get ImportErrors no matter what I do For example: nosetests -x -s sometestname Gives: Traceback (most recent call last): File "/home/ben/.virtualenvs/tsq/lib/python2.6/site-packages/nose-0.11.4-py2.6.egg/nose/loader.py", line 371, in loadTestsFromName

How can you suppress traces for failed test cases using Nose?

自作多情 提交于 2019-12-04 03:41:41
问题 I'm writing a test suit with nose, and would like failing cases to display an output like "FAILED: is_even(5): Not even" instead of the default output: ====================================================================== FAIL: seed_db.test_generator(5,) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest self.test(*self.arg) File "/home/apurcell/tests/prism

Python process will not exit

感情迁移 提交于 2019-12-04 02:42:05
I'm use nosetests to run some tests. However, after the tests have finished running, the nosetests process just sits there, and will not exit. Is there anyway to diagnose this? Does Python have a facility similar to sending Java a kill -QUIT which will print a stack trace? You can enter the debugger and type bt : import pdb; pdb.set_trace() Then you can step through the operation and see where it hangs. nosetests -vv -x -s --pdb test_foo where -x is "Stop running tests after the first error or failure" and --pdb is "Drop into debugger on failures or errors" Also see http://nose.readthedocs.org

Disabling nose coverage report to STDOUT when HTML report is enabled?

折月煮酒 提交于 2019-12-04 02:33:36
I'm using nose (via django-nose ) with the coverage plugin to check test coverage of my Django project. I've configured nose to generate an HTML coverage report on every test run: NOSE_ARGS = [ '--with-coverage', '--cover-package=foot', '--cover-html', '--cover-html-dir=cover', ] Now, I want to disable the plain-text coverage report that gets shown after every test run; the HTML is much more functional, and the long badly-formatted table makes it hard to see actual test output. Neither nosetests nor coverage seems to have such an option, or perhaps I just can't find one? scjody (Taken from