diff --git a/bootstrap_test.go b/bootstrap_test.go index 8d77f81..10baf83 100644 --- a/bootstrap_test.go +++ b/bootstrap_test.go @@ -2,6 +2,7 @@ package txdb_test import ( "database/sql" + "net/url" "testing" ) @@ -25,7 +26,12 @@ const ( // bootstrap bootstraps the database with the nfor tests. func bootstrap(t *testing.T, driver, dsn string) { - db, err := sql.Open(driver, dsn) + parsed, err := url.Parse(dsn) + if err != nil { + t.Fatalf("failed to parse dsn %q: %s", dsn, err) + } + parsed.Path = "" // Remove the database name from the DSN + db, err := sql.Open(driver, parsed.String()) if err != nil { t.Fatal(err) }