nosetests

Append the nose @attr to the test name

孤街醉人 提交于 2019-12-09 13:25:14
问题 I am able to setup nose tests to run with the @attr tag. I am now interested in know if I can append to the end of the test name, the @attr tag? What we are trying to do is add a tag if our tests run into an issue and we write up a defect for it, we would then put the defect number as an @attr tag. Then when we run we could easily identify which tests have open defects against them. Just wondering if this is even possible, and where to go to see how to set it up? EDIT RESULTS RUNNING WITH

'nosetests' not recognized on Windows after being installed and added to PATH

六月ゝ 毕业季﹏ 提交于 2019-12-09 05:52:54
问题 I'm on exercise 46 of Learn Python the Hard Way, and I'm meant to install nose and run nosetests. I've installed nose already using pip, but when I run nosetests in the directory above the 'tests' folder, I get the error: 'nosetests' is not recognized as an internal or external command, operable program or batch file. If it's relevant, I've already modified the PATH variable to include full path of Python27/Scripts and Python/Lib/site-package . 回答1: If you are still having trouble after

How do I measure the execution time of python unit tests with nosetests?

99封情书 提交于 2019-12-09 04:21:15
问题 Is there a way to time the execution time of individual Python tests which are run by nosetests ? 回答1: You might try the nose plug-in posted here: https://github.com/mahmoudimus/nose-timer (or available via pip / PyPi). You can also use the built-in plugin --with-profile to do more serious profiling. 回答2: Alternatively: python -m cProfile -o profile.out `which nosetests` . The output from can be viewed using, for example, runsnakerun, which makes it visually very obvious where your

How to run specific test in Nose2

假如想象 提交于 2019-12-08 14:52:33
问题 In previous version of Nose testing framework, there were several ways to specify only a subset of all tests: nosetests test.module nosetests another.test:TestCase.test_method nosetests a.test:TestCase nosetests /path/to/test/file.py:test_function http://nose.readthedocs.org/en/latest/usage.html#selecting-tests However, I can't find any information about similar test selection in Nose2. There's a mention in docs about different test discovery, but that doesn't seem to be related. Is there a

How to initialize session data in automated test? (python 2.7, webpy, nosetests)

守給你的承諾、 提交于 2019-12-08 03:13:51
问题 I have a web application that uses session data to determine what to do next. The application is running in the browser and does what it shall do. I'd like to write an automated test to have that knowledge for future projects. The last hours I failed miserable to initialize (and hand over) session data within my test. Also I couldn't find the answer for such a basic case on the web. However, here is the app code: import web from project import code urls = ( "/page", "/Page", "/", "Index" )

tipfy nosetest ImportError: No module named fancy_urllib

核能气质少年 提交于 2019-12-07 11:12:27
问题 I am trying to run nosetest using tipfy and google app engine but I keep getting an import error: From the google_appengine directory I execute the following command (directory contains dev_appserver.py): nosetests /Users/me/Documents/python/project/ --with-gae --without-sandbox but I get the following error: Traceback (most recent call last): File "/usr/local/bin/nosetests", line 8, in <module> load_entry_point('nose==0.11.4', 'console_scripts', 'nosetests')() File "/Library/Python/2.6/site

Getting tests to parallelize using nose in python

六月ゝ 毕业季﹏ 提交于 2019-12-07 01:22:52
问题 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

How to initialize session data in automated test? (python 2.7, webpy, nosetests)

久未见 提交于 2019-12-07 01:16:32
I have a web application that uses session data to determine what to do next. The application is running in the browser and does what it shall do. I'd like to write an automated test to have that knowledge for future projects. The last hours I failed miserable to initialize (and hand over) session data within my test. Also I couldn't find the answer for such a basic case on the web. However, here is the app code: import web from project import code urls = ( "/page", "/Page", "/", "Index" ) app = web.application(urls, globals()) # Little hack so that debug mode works with sessions. if web

Problems installing NoseXUnit

南楼画角 提交于 2019-12-06 12:19:59
I tried to install NoseXUnit using pip. Trying to run nosetests with it ends with the following error message: # nosetests --with-nosexunit /usr/lib/python2.7/site-packages/nose-1.3.0-py2.7.egg/nose/plugins/manager.py:395: RuntimeWarning: Unable to load plugin nosexunit = nosexunit.plugin:NoseXUnit: (coverage 3.7.1 (/usr/lib/python2.7/site-packages), Requirement.parse('coverage==2.85')) RuntimeWarning) Usage: nosetests [options] nosetests: error: no such option: --with-nosexunit So it seems like there's a problem with "coverage" version - I have version 3.7.1 and for some reason it requires 2

Specially named directories using nosetests

拟墨画扇 提交于 2019-12-06 07:59:47
Does nosetests treat directories with certain names differently? Is a src directory special? If I have a project whose source directory is named src , nosetests seems to work fine. However, if the directory is named anything else, nosetests reports a bunch of import errors. Here's what I did: run tests ~/src$ nosetests .. ---------------------------------------------------------------------- Ran 2 tests in 0.001s OK rename directory ~/src$ cd .. ~/$ mv src/ src2 rerun tests ~/$ cd src2 ~/src2$ nosetests E ====================================================================== ERROR: Failure: