nosetests

    0热度

    1回答

    有一个名为redirect的函数,它将文件source上的操作临时重定向到文件target。 def redirect(source, target): source.flush() fd = source.fileno() with os.fdopen(os.dup(fd), source.mode) as source2: os.dup2(target

    0热度

    1回答

    我有一个WCF服务(Service1),在Windows服务托管在Server1 WCF服务,该Service1使用的另一种Windows服务托管在Server2,当另一个WCF服务(Service2)我打电话的Service1从WCF test client一个方法,我获得以下错误: The socket connection was aborted. This could be caused

    1热度

    1回答

    发射试验方法我有2个教学班,功能测试 class VehicleTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() def test_math(self): self.assertEqual(1+1, 2) class VehicleTe

    0热度

    2回答

    随着代码 import unittest import logging class LoggingTest(unittest.TestCase): def test_that_logs(self): logging.warning("Hello") logging.info("World") for a in xrange(1000000000

    1热度

    1回答

    这是我的测试类,在mymodule.foo: class Some TestClass(TestCase): def setUpClass(cls): # Do the setup for my tests def test_Something(self) # Test something def test_AnotherThing(self

    1热度

    1回答

    我有以下行的文件有: suite = LazySuite(all_tests) run(suite=suite, argv=['','-c', 'nose.cfg']) 而且我有这个鼻子配置文件: [nosetests] stop=1 with-xunit=1 xunit-file=test.xml 当我运行测试时,以下消息显示: Usage: TestSuite1.py [opt

    4热度

    2回答

    如何在鼻子实例化自己的测试床时调用setup_env()? 我试图用TDD开发一个App Engine应用程序,我需要弄清楚如何模拟用户。 我开始我的测试有: nosetests -v --with-GAE 我有几个人建议使用nosetests因为它会使事情变得更容易。 然而,所有关于如何嘲笑的东西例子似乎明确地使用testbed.setup_env() https://cloud.google.

    0热度

    1回答

    我在Python项目中遇到Sonar-Runner的一个奇怪问题。 这里是我的conf: SonarQube:5.1.2 声纳亚军:2.4 Python的插件:1.5 我有联合国简单的Python项目 “PyTest”: 测试 报告 pgm.py VO.py 我用鼻子(v1.3.7)来生成与该命令的覆盖范围和xUnit的文件: nostetests --with-coverage --cover-

    1热度

    1回答

    我有一个测试函数来操纵对象的内部状态。该对象使用logging.info()记录以下内容。 INFO:root:_change: test light red INFO:root:_change: test light green INFO:root:_change: test light yellow 我怎样才能将它纳入鼻子或unittest功能,以便我可以有一个类似的测试呢? def

    0热度

    2回答

    我已经编写了一个鼻子测试用例,并且希望为另一个测试用例继承相同的对象,因为我将只改变一个参数。 所以,只是为了理解它是如何工作的,我尝试使用2个类NoseTesting和来模拟以下内容。 当我运行此: 我没有看到print语句进行打印。 当我运行的代码中,我得到以下结果: ---------------------------------------------------------------