Skip to content

Commit 39ad3eb

Browse files
committed
Remove unused requires and refactor teardown
1 parent c67d91b commit 39ad3eb

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

activerecord/test/cases/active_record_test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# frozen_string_literal: true
22

33
require "cases/helper"
4-
require "rack"
54

65
class ActiveRecordTest < ActiveRecord::TestCase
76
self.use_transactional_tests = false

activerecord/test/cases/asynchronous_queries_test.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# frozen_string_literal: true
22

33
require "cases/helper"
4-
require "support/connection_helper"
54
require "models/post"
65

76
module AsynchronousQueriesSharedTests
@@ -127,6 +126,10 @@ def setup
127126
end
128127

129128
class AsynchronousExecutorTypeTest < ActiveRecord::TestCase
129+
def teardown
130+
clean_up_connection_handler
131+
end
132+
130133
def test_null_configuration_uses_a_single_null_executor_by_default
131134
old_value = ActiveRecord.async_query_executor
132135
ActiveRecord.async_query_executor = nil
@@ -145,7 +148,6 @@ def test_null_configuration_uses_a_single_null_executor_by_default
145148

146149
assert_equal 2, handler.connection_pool_list(:all).count
147150
ensure
148-
clean_up_connection_handler
149151
ActiveRecord.async_query_executor = old_value
150152
end
151153

@@ -178,7 +180,6 @@ def test_one_global_thread_pool_is_used_when_set_with_default_concurrency
178180
assert_equal 2, handler.connection_pool_list(:all).count
179181
assert_equal async_pool1, async_pool2
180182
ensure
181-
clean_up_connection_handler
182183
ActiveRecord.async_query_executor = old_value
183184
end
184185

@@ -215,7 +216,6 @@ def test_concurrency_can_be_set_on_global_thread_pool
215216
assert_equal 2, handler.connection_pool_list(:all).count
216217
assert_equal async_pool1, async_pool2
217218
ensure
218-
clean_up_connection_handler
219219
ActiveRecord.global_executor_concurrency = old_concurrency
220220
ActiveRecord.async_query_executor = old_value
221221
ActiveRecord.instance_variable_set(:@global_thread_pool_async_query_executor, old_global_thread_pool_async_query_executor)
@@ -269,7 +269,6 @@ def test_multi_thread_pool_executor_configuration
269269
assert_equal 2, handler.connection_pool_list(:all).count
270270
assert_not_equal async_pool1, async_pool2
271271
ensure
272-
clean_up_connection_handler
273272
ActiveRecord.async_query_executor = old_value
274273
end
275274

@@ -304,7 +303,6 @@ def test_multi_thread_pool_is_used_only_by_configurations_that_enable_it
304303
assert_equal 2, handler.connection_pool_list(:all).count
305304
assert_not_equal async_pool1, async_pool2
306305
ensure
307-
clean_up_connection_handler
308306
ActiveRecord.async_query_executor = old_value
309307
end
310308
end

activerecord/test/cases/query_cache_test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
require "models/task"
66
require "models/category"
77
require "models/post"
8-
require "rack"
98

109
class QueryCacheTest < ActiveRecord::TestCase
1110
self.use_transactional_tests = false

0 commit comments

Comments
 (0)