Skip to content

Commit

Permalink
Kraken: Fix test instance locally scoped
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Feb 12, 2024
1 parent 924edb3 commit 5bbffe3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions exchanges/kraken/kraken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var btcusdPair = currency.NewPairWithDelimiter("XBT", "USD", "/")

func TestMain(m *testing.M) {
var err error
k := new(Kraken)
k = new(Kraken)
if err = testexch.TestInstance(k); err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -1186,7 +1186,6 @@ func TestWsSubscribe(t *testing.T) {

k := new(Kraken)
require.NoError(t, testexch.TestInstance(k), "TestInstance must not error")
k.Features.Subscriptions = []*subscription.Subscription{}
testexch.SetupWs(t, k)

err := k.Subscribe([]subscription.Subscription{{Channel: krakenWsTicker, Pairs: currency.Pairs{currency.NewPairWithDelimiter("XBT", "USD", "/")}}})
Expand Down
3 changes: 3 additions & 0 deletions internal/testing/exchange/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ func SetupWs(tb testing.TB, e exchange.IBotExchange) {
return
}

// Disable any default subscriptions, which aren't relevant for tests
b.Features.Subscriptions = []*subscription.Subscription{}

err = w.Connect()
require.NoError(tb, err, "WsConnect should not error")

Expand Down

0 comments on commit 5bbffe3

Please sign in to comment.