Skip to content

Commit

Permalink
[ISSUE-77] example fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Kolesnik committed Sep 26, 2023
1 parent 9ab5c91 commit 63f5dd0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions examples/suite_demo/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ func (s *SetupSuite) TableTestMyTest(t provider.T, example *Example) {
year int
ctx context.Context
)

defer t.WithTestTeardown(func(t provider.T) {
t.WithNewStep("Close ctx", func(sCtx provider.StepCtx) {
ctx.Done()
sCtx.WithNewParameters("ctx", ctx)
})
})

t.WithTestSetup(func(t provider.T) {
t.WithNewStep("init country", func(sCtx provider.StepCtx) {
country = example.country
Expand All @@ -88,13 +96,6 @@ func (s *SetupSuite) TableTestMyTest(t provider.T, example *Example) {
t.Require().NotEqual("PonyCountry", country, "No magic countries in the list")
t.Require().NotEqual(2007, year, "No one returned to 2007")
t.Require().NotNil(ctx, "Not empty context")

defer t.WithTestTeardown(func(t provider.T) {
t.WithNewStep("Close ctx", func(sCtx provider.StepCtx) {
ctx.Done()
sCtx.WithNewParameters("ctx", ctx)
})
})
}

func (s *SetupSuite) TestMyOtherTest(t provider.T) {
Expand Down

0 comments on commit 63f5dd0

Please sign in to comment.