File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,8 @@ func TestTemplatePull_LatestStdout(t *testing.T) {
230
230
231
231
// ToDir tests that 'templates pull' pulls down the active template
232
232
// and writes it to the correct directory.
233
+ //
234
+ // nolint: tparallel // The subtests cannot be run in parallel; see the inner loop.
233
235
func TestTemplatePull_ToDir (t * testing.T ) {
234
236
t .Parallel ()
235
237
@@ -270,8 +272,14 @@ func TestTemplatePull_ToDir(t *testing.T) {
270
272
t .Run (tc .name , func (t * testing.T ) {
271
273
// Use a different working directory to not interfere with actual directory when using relative paths.
272
274
newWD := t .TempDir ()
275
+ cwd , err := os .Getwd ()
276
+ require .NoError (t , err )
273
277
require .NoError (t , os .Chdir (newWD ))
274
278
279
+ t .Cleanup (func () {
280
+ require .NoError (t , os .Chdir (cwd ))
281
+ })
282
+
275
283
t .Cleanup (func () {
276
284
_ = os .RemoveAll (tc .givenPath )
277
285
_ = os .RemoveAll (expectedDest )
You can’t perform that action at this time.
0 commit comments