cockroachdb / cockroachdb/copyist

It's impossible to run copyist.Open* from TestMain

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
850
Forks
21
PR merge metrics
No merged PRs in 30d

Description

```go
func TestMain(m *testing.M) {
flag.Parse()
copyist.Register("postgres")
copyist.SetSessionInit(resetDB)
closer := copyist.OpenNamed("test.copyist", "OpenCopyist")
pop.Connect("copyist-test")
closer.Close()
os.Exit(m.Run())
}
```
This example from README isn't appropriate, because `copyist.OpenNamed(t testingT, pathName, recordingName string) io.Closer` requires `t testingT` as a first argument, but there's no `t *testing.T` in `TestMain` but only `m *testing.M` which does not implement `testingT`.

Is it possible to call `Open*` from `TestMain`?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.