nose

Interactive debugging with nosetests in PyDev

故事扮演 提交于 2019-11-30 19:16:17
I'm using PyDev ( with Aptana ) to write and debug a Python Pylons app, and I'd like to step through the tests in the debugger. Is it possible to launch nosetests through PyDev and stop at breakpoints? Here is what i do to run nosetests using eclipse Pydev (Hope this will help you). first of all i create a python script and i put it in the root of my package directory : --Package | | -- runtest.py | | -- ... (others modules) and in runtest.py i put: import nose nose.main() now i go to in the menu Run -> Run configurations and i create a new configuration of Pydev Django i choose my package and

Getting nose to ignore a function with 'test' in the name

只谈情不闲聊 提交于 2019-11-30 18:19:23
The nose discovery process finds all modules whose name starts with test , and within them all functions which have test in the name and tries to run them as unit tests. See http://nose.readthedocs.org/en/latest/man.html I have a function whose name is say, make_test_account , in the file accounts.py . I want to test that function in a test module called test_account . So at the start of that file I do: from foo.accounts import make_test_account But now I find that nose treats the function make_test_account as a unit test and tries to run it (which fails because it doesn't pass in any

How do I get nose to discover dynamically-generated testcases?

我们两清 提交于 2019-11-30 14:12:35
问题 This is a follow-up to a previous question of mine. In the previous question, methods were explored to implement what was essentially the same test over an entire family of functions, ensuring testing did not stop at the first function that failed. My preferred solution used a metaclass to dynamically insert the tests into a unittest.TestCase. Unfortunately, nose does not pick this up because nose statically scans for test cases. How do I get nose to discover and run such a TestCase? Please

nosetests with tensorflow: lots of debugging output, how to disable

淺唱寂寞╮ 提交于 2019-11-30 13:40:34
When I use nosetests with some test scripts with TensorFlow, I get's lots of debugging output from TensorFlow: az@azmacbookpro ~/P/crnn> nosetests tests/test_TFUtil.py Level 1:tensorflow:Registering FakeQuantWithMinMaxArgs (<function _FakeQuantWithMinMaxArgsGradient at 0x112306048>) in gradient. Level 1:tensorflow:Registering FakeQuantWithMinMaxVars (<function _FakeQuantWithMinMaxVarsGradient at 0x1126ba9d8>) in gradient. Level 1:tensorflow:Registering FakeQuantWithMinMaxVarsPerChannel (<function _FakeQuantWithMinMaxVarsPerChannelGradient at 0x1126ba950>) in gradient. ... Level 1:tensorflow

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

牧云@^-^@ 提交于 2019-11-30 11:44:30
问题 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 bugs earlier (I know rails has something like this with rspec). I am using nose and django-nose. Thanks in advance. 回答1: Use entr: $ find . -name '*.py' | entr python ./manage.py test Or, for extra credit, combine it with ack: $ ack --python | entr

How to suppress verbose Tensorflow logging? [duplicate]

不羁岁月 提交于 2019-11-30 11:18:03
This question already has an answer here: Disable Tensorflow debugging information 9 answers 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): self.assertEquals(True, False) when run with nosetests creates a huge amount of useless logging: FAIL: test_creation (tests.test_tf.MyTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cebrian/GIT

Problems using nose in a virtualenv

独自空忆成欢 提交于 2019-11-30 10:54:11
问题 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 as python setup.py test but when running nosetests straight, there are all sorts of import errors. I've tried it with both a system-wide installation of nose and a virtualenv nose package and no luck. Any thoughts? Thanks!! 回答1: Are you able to run myenv

List all Tests Found by Nosetest

醉酒当歌 提交于 2019-11-30 10:45:50
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? Version 0.11.1 is currently available. You can get a list of tests without running them as follows: nosetests -v --collect-only I recommend using: nosetests -vv --collect-only While the -vv option is not described in man nosetests , "An Extended Introduction to the nose Unit Testing Framework" states that: Using the -vv flag gives you verbose output from nose's test discovery algorithm. This will tell you whether or not nose is

How do I get nose to discover dynamically-generated testcases?

柔情痞子 提交于 2019-11-30 09:44:07
This is a follow-up to a previous question of mine. In the previous question, methods were explored to implement what was essentially the same test over an entire family of functions, ensuring testing did not stop at the first function that failed. My preferred solution used a metaclass to dynamically insert the tests into a unittest.TestCase. Unfortunately, nose does not pick this up because nose statically scans for test cases. How do I get nose to discover and run such a TestCase? Please refer here for an example of the TestCase in question. Nose has a "test generator" feature for stuff

How to set self.maxDiff in nose to get full diff output?

让人想犯罪 __ 提交于 2019-11-30 06:39:35
问题 When using nose 1.2.1 with Python 3.3.0, I sometimes get an error message similar to the following one ====================================================================== FAIL: maxdiff2.test_equal ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.3/site-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/Users/loic/cmrsj/Calculus_II/scrap/maxdiff2.py", line 32, in test_equal assert