diff --git a/lib/Test/Builder/Tester.pm b/lib/Test/Builder/Tester.pm index 936141574..78154b678 100644 --- a/lib/Test/Builder/Tester.pm +++ b/lib/Test/Builder/Tester.pm @@ -92,13 +92,18 @@ sub _start_testing { # Make a detached TestState my $state = $original_state->create( - formatters => [$formatter], + formatters => [], # Preserve existing handlers early_handlers => $original_state->early_handlers, late_handlers => $original_state->late_handlers, ); + # To emulate existing behavior, start testing but don't + # let the formatter see it + $state->post_event( TB2::Event::TestStart->new ); + $state->add_formatters($formatter); + # remember that we're testing $testing = 1; diff --git a/t/Tester/change_formatter.t b/t/Tester/change_formatter.t index d114a0ae8..38e426018 100644 --- a/t/Tester/change_formatter.t +++ b/t/Tester/change_formatter.t @@ -9,8 +9,7 @@ use Test::More; note "change_formatter_class"; { change_formatter_class("TB2::Formatter::TAP"); - test_out("TAP version 13"); - test_out("1..2"); - plan tests => 2; + test_out("ok 1"); + ok(1, ""); test_test("using the new formatter"); }