- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我有一个这样的测试用例嵌套结构:
ControllersTestCase -> ControllerTest
ControllersTestCase -> WidgetTestCase -> WidgetTest
OtherTestCase -> OtherTest
当我运行测试时,我想排除所有扩展 ControllersTestCase
的测试。
我试过像这样向 ControllersTestCase
添加 @group 注释
/**
* @group controllers
*/
class ControllerTestCase extends \Zend_Test_PHPUnit_ControllerTestCase
对于这种情况,我希望所有 Widget 测试也被排除。
当我运行 phpunit --exclude-group controllers
时,测试仍在执行。
我在 ControllerTestCase
下有很多测试,所以这是访问所有测试并向每个测试添加 @group
的最后一个选项。
那么我该怎么做才能排除所有继承自 ControllersTestCase
的测试?
最佳答案
Perhaps the simplest of all elements, because a DocBlock for a class makes full use of the object-oriented principles that PHP offers and inherits the following information from the superclass (unless overridden):
Summary
Description
The following tags:
author copyright package subpackage version
三种方法:
@group
PHPDoc 标签(但这需要大量工作)<exclude>
phpunit.xml
中的标签并指定要排除的路径martTestAsSkipped
内拨setUp
要开始跳过测试的类的方法。所有的子类都会继承它。 (这可能是你的赌注,虽然使用 xml
配置文件更干净和敏捷。但后者可能会很痛苦,因为要指定这些路径)关于Phpunit 基于 TestCase 从执行中排除测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40040243/
我想知道关于为您的测试提供数据的最佳实践的一些事情。 来自docs from django.test import TestCase from myapp.models import Animal c
我有一个实用程序类,它存储对某些单元测试用例有用的方法。我希望这些辅助方法能够执行断言/失败/等等,但似乎我不能使用这些方法,因为它们期望 TestCase 作为它们的第一个参数... 我希望能够将常
我假设 ActionController::TestCase仅用于测试 ActionControllers ,但什么是 ActiveSupport::TestCase测试?它是否测试所有内容(模型、
我最近注意到如果我的测试子类 Test::Unit::TestCase,我的测试数据库在我的测试运行后没有被清理。如果我的测试子类 ActiveSupport::TestCase,一切都被正确清理。
我是 junit test android 的初学者。我正在关注 this tutorial但是得到这个错误 junit.framework.AssertionFailedError: Class c
我仍在使用 Django 1.2.1,我认为对于较新的 Django,我们不会 import unittest然后做unittest.TestCase . 插图 import unittest cla
我正在使用 Green Coffee library在我的仪器测试中运行 Cucumber 场景。我一步一步地按照 repo 提供的示例进行操作,但这是错误: junit.framework.Asse
这是多项式的add方法 public Polynomilal add (Polynomial poly){ //getA()..etc getters for the coefficients of
让我的单元测试类继承 unittest.TestCase 而不是 object 背后的动机是什么? 如果我使用 Nose(或 PyTest)来代替,这有什么关系吗? 单元测试? 最佳答案 如果您不继承
今天我写了测试,并在其中一种测试方法中打错了字。我的测试失败了,但我不明白为什么。是 Python 属性的特殊行为还是其他? from unittest import TestCase class F
我们希望能够看到哪些新的测试用例工作项尚未与测试计划/测试套件相关联。 我认为,如果我们可以在 Visual Studio 的 TFS 中运行此查询,那么我们可以将其保存下来,测试人员可以在测试管理器
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
我有 Django 1.4。在我的 test.py 中,我有必要的 TestCase 导入: from django.test import TestCase 为了隔离问题,我添加了以下行: fixt
每当我尝试在 Selenium 中播放测试用例时,我总是会遇到此错误 [error] Permission denied for to get property Location.href 最
我有我的网站使用的两个数据库,我有一个使用这两个数据库的应用程序。我需要编写一个测试用例来加载两个数据库的夹具。我使用了一个 DB 路由器,它在生产中运行良好,但在测试框架中,Django 坚持对所有
我目前正在为 Django 应用程序编写一些测试。我的应用程序的 Signals.py 文件中有以下独立函数: def updateLeaveCounts(): # Setting some v
假设我有一个方法可以将一些数据填充到列表中,它在内部调用另一个方法(我正在独立测试)并将一些数据填充到列表中。这里最好的测试方法是什么? 如何测试外部方法?我是否也应该检查来自内部方法的数据,否则只测
在 Test Manager 2010 中,我似乎无法在基于需求的测试套件中订购测试用例(在普通测试套件中订购测试用例工作正常) 请任何人向我解释为什么他们禁止我这样做,或建议一种解决方法 非常感谢
我目前正在尝试为应用程序编写第一个 Django 规范。但是,每次运行测试时,我都会收到 IntegrityError: UNIQUEconstraint failed: auth_user.user
我有一个 python 模块,它定义了一组基类,然后另一个 python 模块实现了这些基类。 核心Python模块还具有测试用例,用于测试基类是否正确实现。 在第二个模块的测试套件中,我想从第一个模
我是一名优秀的程序员,十分优秀!