Skip to content

Commit 8a16c4f

Browse files
committed
Use excplicit Test::Exception on deploy.t
Refactor the deploy.t to remove the Try::Tiny dependency in order to use the explicit function from Test::Exception. https://progress.opensuse.org/issues/176862
1 parent a69a2ec commit 8a16c4f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

t/deploy.t

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use OpenQA::Test::TimeLimit '20';
1919
use OpenQA::Test::Case;
2020
use Mojo::File 'path';
2121
use List::Util 'min';
22-
use Try::Tiny;
2322

2423
plan skip_all => 'set TEST_PG to e.g. "DBI:Pg:dbname=test" to enable this test' unless $ENV{TEST_PG};
2524

@@ -46,11 +45,8 @@ my $dh = DBIx::Class::DeploymentHandler->new(
4645
databases => 'PostgreSQL',
4746
force_overwrite => 0,
4847
});
49-
my $deployed_version;
50-
try {
51-
$deployed_version = $dh->version_storage->database_version;
52-
};
53-
ok(!$deployed_version, 'DB not deployed by plain schema connection with deploy => 0');
48+
throws_ok { $dh->version_storage->database_version } 'DBIx::Class::Exception',
49+
'DB not deployed by plain schema connection with deploy => 0';
5450

5551
my $ret = $schema->deploy;
5652
ok($dh->version_storage->database_version, 'DB deployed');

0 commit comments

Comments
 (0)