Skip to content

Commit

Permalink
Merge branch 'main' into feat/wait-submatch
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenh authored Dec 20, 2024
2 parents 50bfda7 + 4f67ae0 commit 9ca35b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,8 @@ func TestWithNewNetworkContextTimeout(t *testing.T) {
require.Empty(t, req.Networks)
require.Empty(t, req.NetworkAliases)
}

func TestCleanupWithNil(t *testing.T) {
var network *testcontainers.DockerNetwork
testcontainers.CleanupNetwork(t, network)
}
4 changes: 3 additions & 1 deletion testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ func CleanupNetwork(tb testing.TB, network Network) {
tb.Helper()

tb.Cleanup(func() {
noErrorOrIgnored(tb, network.Remove(context.Background()))
if !isNil(network) {
noErrorOrIgnored(tb, network.Remove(context.Background()))
}
})
}

Expand Down

0 comments on commit 9ca35b0

Please sign in to comment.