From 102bbda633d7439b7a4ab924dd3dc773c242aee4 Mon Sep 17 00:00:00 2001 From: Gareth Kirwan Date: Thu, 21 Sep 2023 09:21:49 +0700 Subject: [PATCH] Kraken: Move UpdateTradablePairs to a test 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 --- exchanges/kraken/kraken_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/exchanges/kraken/kraken_test.go b/exchanges/kraken/kraken_test.go index 7f417ac3267..bfa24a1fa40 100644 --- a/exchanges/kraken/kraken_test.go +++ b/exchanges/kraken/kraken_test.go @@ -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)