<commit_before>package mysql

import (
	"database/sql"
	"fmt"
	"testing"
	"time"

	"github.com/178inaba/fizzbuzz-twitterbot/model"
	sq "github.com/Masterminds/squirrel"
	"github.com/stretchr/testify/suite"
)

type prepareExecerSuite struct {
	suite.Suite

	db     *sql.DB
	execer prepareExecer
}

func TestPrepareExecerSuite(t *testing.T) {
	suite.Run(t, new(prepareExecerSuite))
}

func (s *prepareExecerSuite) SetupTest() {
	db, err := Open("root", "", "fizzbuzz_twitterbot_test")
	s.NoError(err)

	s.db = db
	s.execer = prepareExecer{db: db}

	// Reset test db.
	_, err = s.db.Exec("SET FOREIGN_KEY_CHECKS = 0")
	s.NoError(err)
	_, err = s.db.Exec(fmt.Sprintf("TRUNCATE TABLE %s", model.PostErrorTableName))
	s.NoError(err)
	_, err = s.db.Exec(fmt.Sprintf("TRUNCATE TABLE %s", model.FizzbuzzTweetTableName))
	s.NoError(err)
	_, err = s.db.Exec("SET FOREIGN_KEY_CHECKS = 1")
	s.NoError(err)
}
<commit_msg>Fix test setup.<commit_after>package mysql

import (
	"database/sql"
	"fmt"
	"testing"
	"time"

	"github.com/178inaba/fizzbuzz-twitterbot/model"
	sq "github.com/Masterminds/squirrel"
	"github.com/stretchr/testify/suite"
)

type prepareExecerSuite struct {
	suite.Suite

	db     *sql.DB
	execer prepareExecer
}

func TestPrepareExecerSuite(t *testing.T) {
	suite.Run(t, new(prepareExecerSuite))
}

func (s *prepareExecerSuite) SetupTest() {
	db, err := Open("root", "", "fizzbuzz_twitterbot_test")
	s.NoError(err)

	s.db = db
	s.execer = prepareExecer{db: db}

	// Reset test db.
	_, err = s.db.Exec("SET FOREIGN_KEY_CHECKS = 0")
	s.NoError(err)
	_, err = s.db.Exec(fmt.Sprintf("TRUNCATE TABLE %s", model.FizzbuzzTweetTableName))
	s.NoError(err)
	_, err = s.db.Exec("SET FOREIGN_KEY_CHECKS = 1")
	s.NoError(err)
}

{'fraction_non_alphanumeric': 0.15348837209302327, 'fraction_numerical': 0.005813953488372093, 'mean_word_length': 4.533762057877814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3711550', 'n_tokens_mistral': 738, 'n_tokens_neox': 720, 'n_words': 122}