summaryrefslogtreecommitdiff
path: root/client/options_test.go
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2022-03-06 22:45:04 +0100
committerSebastiaan van Stijn <github@gone.nl>2022-05-28 12:12:39 +0200
commita5f650095801b3defaf34cd0466f67ed64eda18e (patch)
tree406ca5fde6d0ec4b828cf334aeef1bb736a1f467 /client/options_test.go
parentc93bffa1b28d6b51486043cdd8c219b37082ec40 (diff)
downloaddocker-a5f650095801b3defaf34cd0466f67ed64eda18e.tar.gz
replace deprecated gotest.tools' env.Patch() with t.SetEnv()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'client/options_test.go')
-rw-r--r--client/options_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/client/options_test.go b/client/options_test.go
index b4ea0902e6..51900cef26 100644
--- a/client/options_test.go
+++ b/client/options_test.go
@@ -6,7 +6,6 @@ import (
"github.com/docker/docker/api"
"gotest.tools/v3/assert"
- "gotest.tools/v3/env"
)
func TestOptionWithHostFromEnv(t *testing.T) {
@@ -18,7 +17,7 @@ func TestOptionWithHostFromEnv(t *testing.T) {
assert.Equal(t, c.addr, defaultAddr)
assert.Equal(t, c.basePath, "")
- defer env.Patch(t, "DOCKER_HOST", "tcp://foo.example.com:2376/test/")()
+ t.Setenv("DOCKER_HOST", "tcp://foo.example.com:2376/test/")
c, err = NewClientWithOpts(WithHostFromEnv())
assert.NilError(t, err)
@@ -44,7 +43,7 @@ func TestOptionWithVersionFromEnv(t *testing.T) {
assert.Equal(t, c.version, api.DefaultVersion)
assert.Equal(t, c.manualOverride, false)
- defer env.Patch(t, "DOCKER_API_VERSION", "2.9999")()
+ t.Setenv("DOCKER_API_VERSION", "2.9999")
c, err = NewClientWithOpts(WithVersionFromEnv())
assert.NilError(t, err)