This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=d9215012601b4b54aaa5f3edc3d7bd530235cb1e

commit d9215012601b4b54aaa5f3edc3d7bd530235cb1e
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Oct 26 23:14:35 2022 +0200

    Test::Dpkg: Make test_get_temp_path() remove the path before creating it
    
    This makes sure each test group starts with a clean temporary directory,
    with no side effects from any previous run.
---
 scripts/Test/Dpkg.pm            | 3 ++-
 scripts/t/Dpkg_Source_Archive.t | 4 +---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm
index 9a75c0420..c6e2bcf24 100644
--- a/scripts/Test/Dpkg.pm
+++ b/scripts/Test/Dpkg.pm
@@ -55,7 +55,7 @@ use Exporter qw(import);
 use Cwd;
 use File::Find;
 use File::Basename;
-use File::Path qw(make_path);
+use File::Path qw(make_path rmtree);
 use IPC::Cmd qw(can_run);
 use Test::More;
 
@@ -94,6 +94,7 @@ sub test_get_temp_path
     my $path = shift // _test_get_caller_dir();
     $path = 't.tmp/' . fileparse($path);
 
+    rmtree($path);
     make_path($path);
     return $path;
 }
diff --git a/scripts/t/Dpkg_Source_Archive.t b/scripts/t/Dpkg_Source_Archive.t
index 504fbe1d4..f6fe82fd8 100644
--- a/scripts/t/Dpkg_Source_Archive.t
+++ b/scripts/t/Dpkg_Source_Archive.t
@@ -20,7 +20,7 @@ use Test::More tests => 4;
 use Test::Dpkg qw(:paths);
 
 use File::Spec;
-use File::Path qw(make_path rmtree);
+use File::Path qw(make_path);
 
 BEGIN {
     use_ok('Dpkg::Source::Archive');
@@ -30,8 +30,6 @@ use Dpkg;
 
 my $tmpdir = test_get_temp_path();
 
-rmtree($tmpdir);
-
 sub test_touch
 {
     my ($name, $data) = @_;

-- 
Dpkg.Org's dpkg

Reply via email to