Skip to content

Commit

Permalink
Merge pull request #78 from ozontech/release/issue-77
Browse files Browse the repository at this point in the history
  • Loading branch information
koodeex authored Oct 26, 2023
2 parents dd2cfa9 + 63f5dd0 commit b670f1c
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 b670f1c

Please sign in to comment.