nose

Is there any way to install nose in Maya?

喜夏-厌秋 提交于 2019-12-08 10:42:54
问题 I'm using Autodesk Maya 2008 on Linux at home, and Maya 2012 on Windows 7 at work. Most of my efforts so far have been focused on the former. I found this thread, and managed to get the setup there working at home. The gist of it is that you install nose for whatever Python you have installed on your system, then create a py script that adds that nose egg to sys.path, and loads in the maya.standalone module, then imports nose and runs it. Then you run that py script through Maya's version of

PYTHON: nosetests import file path with multiple modules/files

跟風遠走 提交于 2019-12-08 07:06:42
问题 I'm currently working through LearnPythonTheHardWay and have reached Exercise 48 which details Nosetests . I am able to perform a unit testing as long as all of the code is in a single python.py file. However if I include other files as part of a program, i.e. use import and then attempt to nosetest such a project I am getting an error, as follows: ====================================================================== ERROR: Failure: ImportError (No module named 'temp') Traceback (most recent

Learn Python the Hard Way Exercise 46: Installing Python packages (pip, nose etc.) on Windows

纵然是瞬间 提交于 2019-12-07 16:07:06
问题 I am learning Python using Zed Shaw's "Learn Python the Hard Way" on Windows using PowerShell. I am in Exercise 46 where you set up a skelton project. I downloaded pip, distribute, nose, and virtualenv and I installed them by typing: python <filename>.py install However, probably because they were not installed where they were supposed to, when I try nosetests I get errors saying "The term 'nosetests' is not recognized as the name of a cmdelt, function, script file, or operable program. Check

PyCharm unable to load NoseGAE

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 14:57:01
问题 I've created a nose test config in PyCharm. I have NoseGAE installed in the virtualenv where I'm working. Running tests from the terminal with ./env/bin/nosetests --with-gae src/tests works great. The PyCharm test config, however, yields /Users/bistenes/Code/myproject/env/bin/python /Applications/PyCharm.app/Contents/helpers/pycharm/noserunner.py src/tests/ Testing started at 6:31 PM ... /Users/bistenes/Code/myproject/env/lib/python2.7/site-packages/nose/plugins/manager.py:395: RuntimeWarning

Can I nest TestCases with Nose?

本秂侑毒 提交于 2019-12-07 10:06:47
问题 I've become a fan of nested test case contexts in things like RSpec and Jasmine, and I'm wondering if there are any Nose plugins that implement a test finder that allows you to nest classes as context. The resulting tests would look something like the following: from nose.tools import * from mysystem import system_state class TestMySystem (TestCase): def setUp(self): system_state.initialize() class WhenItIsSetTo1 (TestCase): def setUp(self): system_state.set_to(1) def test_system_should_be_1

__init__.py in project folder breaks nose tests

限于喜欢 提交于 2019-12-07 04:50:30
问题 project tree: . |-- bar.py `-- test |-- __init__.py `-- test_bar.py bar.py: def dumb_true(): return True tests/test_bar.py: import bar def test_bar_true(): assert bar.dumb_true() I can run nosetests from inside the project or its test directory. If I add an empty __init__.py to the project folder, however, I can no longer run nosetests from inside the test directory, which doesn't make any sense to me. . |-- bar.py |-- __init__.py <-- new, empty file, ruining everything `-- test |-- __init__

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

nose2 vs py.test with isolated processes

好久不见. 提交于 2019-12-07 01:08:54
问题 We have been using nosetest for running and collecting our unittests (which are all written as python unittests which we like). Things we like about nose: uses standard python unit tests (we like the structure this imposes). supports reporting coverage and test output in xml (for jenkins). What we are missing is a good way to run tests in isolated processes while maintaining good error repoorting (we are testing C++ libraries through python so segfaults should not be catastrophic). nosepipe

How to produce html unit test output in Python?

只愿长相守 提交于 2019-12-06 21:25:53
问题 I'm looking for any way to display the results of python unit tests in an html summary. There are tools like this for Java and Ruby... haven't yet located any tools that seem to do this for Python. Are there any out there? JUnit html output: (source: ibm.com) Ruby RSpec output: (source: natontesting.com) 来源: https://stackoverflow.com/questions/1758354/how-to-produce-html-unit-test-output-in-python

Python 2.7 Unit test: Assert logger warning thrown

∥☆過路亽.° 提交于 2019-12-06 17:30:56
问题 I'm trying to write a Unit Test for a piece of python code that raises a warning via logger.warn('...') under certain conditions. How do I assert that this warning has been logged? I noticed that assertLogged is not available until at least Python 3.4, unfortunately I am in 2.7. 回答1: Python 3.4 Added to unittest exactly that feature. See TestCase.assertLogs. The API is really easy to use: with self.assertLogs('foo', level='INFO') as cm: logging.getLogger('foo').info('first message') logging