Replace context.Background with testing.TB.Context where possible (#15416)

* Replace context.Background with testing.TB.Context where possible

* Fix failing tests
This commit is contained in:
Preston Van Loon
2025-06-16 17:09:18 -05:00
committed by GitHub
parent 6a13ba9125
commit 62fec4d1f3
409 changed files with 3175 additions and 3456 deletions

View File

@@ -2,7 +2,6 @@ package main
import (
"bufio"
"context"
"encoding/hex"
"fmt"
"path/filepath"
@@ -69,7 +68,7 @@ func Test_spreadKeysAcrossImportedWallets(t *testing.T) {
walletPassword,
)
require.NoError(t, err)
ctx := context.Background()
ctx := t.Context()
for i := 0; i < numWallets; i++ {
w, err := wallet.OpenWallet(ctx, &wallet.Config{
WalletDir: filepath.Join(tmpDir, fmt.Sprintf("wallet_%d", i)),