summaryrefslogtreecommitdiff
path: root/internal/db/bundb/poll_test.go
diff options
context:
space:
mode:
authorLibravatar Daenney <git@noreply.sourcery.dny.nu>2025-05-22 12:26:11 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-05-22 12:26:11 +0200
commitd5c9c4adc167cdb05e73f5105702cf340293e61c (patch)
tree1d21fe376099864900837eba675a965517f98e5d /internal/db/bundb/poll_test.go
parent[feature] Allow exposing allows, implement `/api/v1/domain_blocks` and `/api/... (diff)
downloadgotosocial-d5c9c4adc167cdb05e73f5105702cf340293e61c.tar.xz
[chore] Upgrade to Go 1.24 (#4187)
* Set `go.mod` to 1.24 now that it's been out for 3 months. * Update all the test to use `testing.T.Context()`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4187 Co-authored-by: Daenney <git@noreply.sourcery.dny.nu> Co-committed-by: Daenney <git@noreply.sourcery.dny.nu>
Diffstat (limited to 'internal/db/bundb/poll_test.go')
-rw-r--r--internal/db/bundb/poll_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/db/bundb/poll_test.go b/internal/db/bundb/poll_test.go
index 04c8609e8..09a152c1d 100644
--- a/internal/db/bundb/poll_test.go
+++ b/internal/db/bundb/poll_test.go
@@ -39,7 +39,7 @@ func (suite *PollTestSuite) TestGetPollBy() {
t := suite.T()
// Create a new context for this test.
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
// Sentinel error to mark avoiding a test case.
@@ -103,7 +103,7 @@ func (suite *PollTestSuite) TestGetPollVoteBy() {
t := suite.T()
// Create a new context for this test.
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
// Sentinel error to mark avoiding a test case.
@@ -175,7 +175,7 @@ func (suite *PollTestSuite) TestGetPollVoteBy() {
func (suite *PollTestSuite) TestUpdatePoll() {
// Create a new context for this test.
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
for _, poll := range suite.testPolls {
@@ -200,7 +200,7 @@ func (suite *PollTestSuite) TestUpdatePoll() {
func (suite *PollTestSuite) TestPutPoll() {
// Create a new context for this test.
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
for _, poll := range suite.testPolls {
@@ -220,7 +220,7 @@ func (suite *PollTestSuite) TestPutPoll() {
func (suite *PollTestSuite) TestPutPollVote() {
// Create a new context for this test.
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
// randomChoices generates random vote choices in poll.
@@ -271,7 +271,7 @@ func (suite *PollTestSuite) TestPutPollVote() {
func (suite *PollTestSuite) TestDeletePoll() {
// Create a new context for this test.
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
for _, poll := range suite.testPolls {
@@ -286,7 +286,7 @@ func (suite *PollTestSuite) TestDeletePoll() {
}
func (suite *PollTestSuite) TestDeletePollVotesBy() {
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
for _, vote := range suite.testPollVotes {
@@ -308,7 +308,7 @@ func (suite *PollTestSuite) TestDeletePollVotesBy() {
}
func (suite *PollTestSuite) TestDeletePollVotesByNoAccount() {
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
// Try to delete a poll by nonexisting account.