Unverified Commit 8322e178 authored by Darren Austin's avatar Darren Austin Committed by GitHub

Revert "Added 'exclude' parameter to 'testWidgets()'. (#86397)" (#87515)

parent 40739568
......@@ -115,14 +115,6 @@ E? _lastWhereOrNull<E>(Iterable<E> list, bool Function(E) test) {
/// each value of the [TestVariant.values]. If [variant] is not set, the test
/// will be run once using the base test environment.
///
/// If either [exclude] or [skip] is `true`, then the test will be skipped. The
/// difference is that [skip] is a temporary way to disable a problematic test
/// while a fix is being developed. It should have a comment after it with a
/// link to a tracking issue for the work on re-enabling the test.
///
/// [exclude] is used to indicate that the test is not designed to run under
/// the condition given and should always be skipped when it is `true`.
///
/// If the [tags] are passed, they declare user-defined tags that are implemented by
/// the `test` package.
///
......@@ -140,26 +132,11 @@ E? _lastWhereOrNull<E>(Iterable<E> list, bool Function(E) test) {
/// expect(find.text('Success'), findsOneWidget);
/// });
/// ```
///
/// ### Excluded test
/// ```dart
/// testWidgets('Some test that will never make sense for the web', (WidgetTester tester) async {
/// // test code
/// }, exclude: isBrowser);
/// ```
///
/// ### Skipped test
/// ```dart
/// testWidgets('Some flaky test', (WidgetTester tester) async {
/// // test code
/// }, skip: true); // https://github.com/flutter/flutter/issues/12345
/// ```
@isTest
void testWidgets(
String description,
WidgetTesterCallback callback, {
bool skip = false,
bool exclude = false,
bool? skip,
test_package.Timeout? timeout,
Duration? initialTimeout,
bool semanticsEnabled = true,
......@@ -207,7 +184,7 @@ void testWidgets(
timeout: initialTimeout,
);
},
skip: (exclude || skip) ? true : null,
skip: skip,
timeout: timeout ?? binding.defaultTestTimeout,
tags: tags,
);
......
......@@ -738,16 +738,6 @@ void main() {
});
});
group('Skip and exclude work', () {
testWidgets('skipping a test skips it', (WidgetTester tester) async {
expect(true, false); // shouldn't get here
}, skip: true); // https://github.com/someissue
testWidgets('excluding a test skips it', (WidgetTester tester) async {
expect(true, false); // shouldn't get here
}, exclude: true);
});
group('Pending timer', () {
late TestExceptionReporter currentExceptionReporter;
setUp(() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment