Skip to content

Commit 4e73293

Browse files
chore: tweak http client (#458)
* chore(deps-dev): update rubocop requirement from = 1.47.0 to = 1.48.1 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](rubocop/rubocop@v1.47.0...v1.48.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * fix rubocop * chore: tweak http client * fix rubocop --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent ea2765a commit 4e73293

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

lib/appium_lib_core/common/base/driver.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class Driver < ::Selenium::WebDriver::Driver
4444
# Do not use this for general use. Used by flutter driver to get bridge for creating a new element
4545
attr_reader :bridge
4646

47-
def initialize(bridge: nil, listener: nil, **opts)
47+
# override
48+
def initialize(bridge: nil, listener: nil, **opts) # rubocop:disable Lint/MissingSuper
4849
original_opts = opts.dup
4950

5051
# For ::Appium::Core::Waitable

lib/appium_lib_core/driver.rb

+1-7
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,7 @@ def attach_to(session_id, url: nil, automation_name: nil, platform_name: nil,
505505
end
506506

507507
def get_http_client(http_client: nil, open_timeout: nil, read_timeout: nil)
508-
client = http_client || Appium::Core::Base::Http::Default.new
509-
510-
# open_timeout and read_timeout are explicit wait.
511-
client.open_timeout = open_timeout if open_timeout
512-
client.read_timeout = read_timeout if read_timeout
513-
514-
client
508+
http_client || Appium::Core::Base::Http::Default.new(open_timeout: open_timeout, read_timeout: read_timeout)
515509
end
516510

517511
# Ignore setting default wait if the target driver has no implementation

test/test_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def mac2
378378
end
379379

380380
def parallel?
381-
ENV.fetch 'PARALLEL'
381+
ENV.fetch 'PARALLEL', false
382382
end
383383

384384
private

0 commit comments

Comments
 (0)