mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 19:51:20 +00:00
f9303ca2e4
* Clean ups * Gazelle
27 lines
496 B
Go
27 lines
496 B
Go
package kv
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
logrus.SetLevel(logrus.DebugLevel)
|
|
logrus.SetOutput(ioutil.Discard)
|
|
|
|
m.Run()
|
|
}
|
|
|
|
func setupDB(t testing.TB) *Store {
|
|
cfg := &Config{}
|
|
db, err := NewKVStore(t.TempDir(), cfg)
|
|
require.NoError(t, err, "Failed to instantiate DB")
|
|
t.Cleanup(func() {
|
|
require.NoError(t, db.Close(), "Failed to close database")
|
|
})
|
|
return db
|
|
}
|