Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not skip test class with test_skip method #25

Open
potatogim opened this issue Mar 7, 2014 · 1 comment
Open

Can not skip test class with test_skip method #25

potatogim opened this issue Mar 7, 2014 · 1 comment
Labels

Comments

@potatogim
Copy link

Hi, I have a question about 'is_skipped()' method.

I make some class and then wrote test code that have skip test. (naturally, in the startup method)

but after run $test_suite->runtests and run $report->all_test_classes, checking skipped test class(is_skipped()) was not working right.

Code

...

use Test::Class::Moose::Load abs_path(dirname $0) . '/t/lib';

...

### MyTest is parent class of the Test::Sample1, Test::Sample2 
my $test_suite = Test::MyTest->new(
    test_classes => ['Test::Sample1', 'Test::Sample2']
);

...

subtest 'UnitTest Suite' => sub
{
    $test_suite->runtests;
};

my $report = $test_suite->test_report;

for my $class ($report->all_test_classes)
{
    my $class_name = $class->name;

    ok (!$class->is_skipped, "$class_name was not skipped");

Output

ok 3 - Test::Sample1 methods
# Run-time for Test::Sample1: 0.044265 wallclock secs ( 0.04 usr +  0.00 sys =  0.04 CPU)
not ok 4 - Test::Sample2 was not skipped
#   Failed test 'Test::Sample2 was not skipped'
#   at UnitTest line 74.
    # Subtest: Test::Sample2 methods
    1..0
    # No tests run!
not ok 5 - No tests run for subtest "Test::Sample2 methods"
#   Failed test 'No tests run for subtest "Test::Sample2 methods"'
#   at UnitTest line 89.
Can't call method "duration" on an undefined value at UnitTest line 92.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 29 just after 5.
@autarch
Copy link
Member

autarch commented Jul 6, 2015

Can you produce a complete example to trigger this bug? That would make it a lot easier to fix.

@autarch autarch changed the title can not skip test class with test_skip method. Can not skip test class with test_skip method Aug 9, 2015
@autarch autarch added the stalled label Aug 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants