Skip to content

Commit

Permalink
Kraken: Move UpdateTradablePairs to a test
Browse files Browse the repository at this point in the history
This should not happen in TestMain just because it's a requirement for
most tests. It should just be a non-parallel early test.
That allows unit tests to run quickly without calling it, and allows
proper clear failures
  • Loading branch information
gbjk committed Oct 1, 2023
1 parent 944db47 commit 102bbda
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions exchanges/kraken/kraken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ func TestMain(m *testing.M) {
if err != nil {
log.Fatal(err)
}
err = k.UpdateTradablePairs(context.Background(), true)
if err != nil {
log.Fatal(err)
}
os.Exit(m.Run())
}

func TestUpdateTradablePairs(t *testing.T) {
err := k.UpdateTradablePairs(context.Background(), true)
assert.NoError(t, err, "Update tradable Pairs should not error")
}

func TestStart(t *testing.T) {
t.Parallel()
err := k.Start(context.Background(), nil)
Expand Down

0 comments on commit 102bbda

Please sign in to comment.