PY-29371: Sync with teamcity(#176): purge tests on "scenario" call

When some scenarios are skipped due to tags, behave reports their steps but never reports "match" for them.

So, on next "match" stale (ignored actually) step is left on stack and used instead of real one
This commit is contained in:
Ilya.Kazakevich
2018-04-05 19:51:48 +03:00
parent 4f24cbebe4
commit 1bd950ed71
2 changed files with 8 additions and 6 deletions
@@ -55,6 +55,7 @@ class TeamcityFormatter(Formatter):
assert isinstance(scenario, Scenario)
self.__scenario = scenario
self.__scenario_opened = False
self.__steps.clear()
def step(self, step):
assert isinstance(step, Step)
+7 -6
View File
@@ -22,9 +22,10 @@ import org.jetbrains.annotations.NotNull;
/**
* Provides high level API for number of tests calculations in {@link SMTestProxy}
*
* @author Ilya.Kazakevich
*/
final class SMRootTestsCounter {
public final class SMRootTestsCounter {
/**
* Filter to exclude suites
*/
@@ -41,7 +42,7 @@ final class SMRootTestsCounter {
/**
* @param testProxy proxy to wrap
*/
SMRootTestsCounter(@NotNull final SMRootTestProxy testProxy) {
public SMRootTestsCounter(@NotNull final SMRootTestProxy testProxy) {
myTestProxy = testProxy;
}
@@ -53,18 +54,18 @@ final class SMRootTestsCounter {
/**
* @return number of failed tests
*/
int getFailedTestsCount() {
public int getFailedTestsCount() {
return myTestProxy.collectChildren(NOT_SUIT.and(Filter.FAILED_OR_INTERRUPTED)).size();
}
/**
* @return number of passed tests
*/
int getPassedTestsCount() {
public int getPassedTestsCount() {
return myTestProxy.collectChildren(NOT_SUIT.and(Filter.PASSED)).size();
}
int getIgnoredTestsCount() {
public int getIgnoredTestsCount() {
return myTestProxy.collectChildren(NOT_SUIT.and(Filter.IGNORED)).size();
}
@@ -72,7 +73,7 @@ final class SMRootTestsCounter {
/**
* @return number of all tests
*/
int getAllTestsCount() {
public int getAllTestsCount() {
return myTestProxy.collectChildren(NOT_SUIT).size();
}
}