Remove test group in favour of addTearDown (#17962)

This commit is contained in:
Danny Tuppeny
2018-05-28 21:45:56 +01:00
committed by GitHub
parent 7c60b7405a
commit 514701fe46
4 changed files with 15 additions and 16 deletions

View File

@@ -18,7 +18,7 @@ When the exception was thrown, this was the stack:
The test description was:
TestAsyncUtils - handling unguarded async helper functions
════════════════════════════════════════════════════════════════════════════════════════════════════
.*..:.. \+0 -1: - TestAsyncUtils - handling unguarded async helper functions *
.*..:.. \+0 -1: TestAsyncUtils - handling unguarded async helper functions *
Test failed\. See exception logs above\.
The test description was: TestAsyncUtils - handling unguarded async helper functions
*

View File

@@ -9,7 +9,7 @@ There was one transient callback left. The stack trace for when it was registere
#[0-9]+ main.+ \(.+/dev/automated_tests/flutter_test/ticker_test\.dart:[0-9]+:[0-9]+\)
<<skip until matching line>>
════════════════════════════════════════════════════════════════════════════════════════════════════
.*..:.. \+0 -1: - Does flutter_test catch leaking tickers\? \[E\]
.*..:.. \+0 -1: Does flutter_test catch leaking tickers\? \[E\]
Test failed\. See exception logs above\.
The test description was: Does flutter_test catch leaking tickers\?
*

View File

@@ -1,2 +1,2 @@
[0-9]+:[0-9]+ [+]0: - A trivial widget test
[0-9]+:[0-9]+ [+]0: A trivial widget test
[0-9]+:[0-9]+ [+]1: All tests passed!

View File

@@ -57,20 +57,19 @@ void testWidgets(String description, WidgetTesterCallback callback, {
final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
final WidgetTester tester = new WidgetTester._(binding);
timeout ??= binding.defaultTestTimeout;
test_package.group('-', () {
test_package.test(
description,
() {
return binding.runTest(
() => callback(tester),
tester._endOfTestVerifications,
description: description ?? '',
);
},
skip: skip,
);
test_package.tearDown(binding.postTest);
}, timeout: timeout);
description,
() {
test_package.addTearDown(binding.postTest);
return binding.runTest(
() => callback(tester),
tester._endOfTestVerifications,
description: description ?? '',
);
},
skip: skip,
timeout: timeout
);
}
/// Runs the [callback] inside the Flutter benchmark environment.