mirror of https://github.com/jackc/pgx.git
Simplify pgconn tests by using T.TempDir
parent
3e6c719698
commit
7cf7bc6054
|
@ -2103,8 +2103,9 @@ func TestConnCopyFromGzipReader(t *testing.T) {
|
|||
)`).ReadAll()
|
||||
require.NoError(t, err)
|
||||
|
||||
f, err := os.CreateTemp("", "*")
|
||||
f, err := os.CreateTemp(t.TempDir(), "*")
|
||||
require.NoError(t, err)
|
||||
defer f.Close()
|
||||
|
||||
gw := gzip.NewWriter(f)
|
||||
|
||||
|
@ -2137,12 +2138,6 @@ func TestConnCopyFromGzipReader(t *testing.T) {
|
|||
err = gr.Close()
|
||||
require.NoError(t, err)
|
||||
|
||||
err = f.Close()
|
||||
require.NoError(t, err)
|
||||
|
||||
err = os.Remove(f.Name())
|
||||
require.NoError(t, err)
|
||||
|
||||
result := pgConn.ExecParams(ctx, "select * from foo", nil, nil, nil, nil).Read()
|
||||
require.NoError(t, result.Err)
|
||||
|
||||
|
|
Loading…
Reference in New Issue