Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use allowed_method option instead of method_whitelist #350

Merged
merged 3 commits into from Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion launchable/utils/http_client.py
Expand Up @@ -39,7 +39,7 @@ def __init__(self, base_url: str = "", session: Session = None, test_runner: str
if session is None:
strategy = Retry(
total=3,
method_whitelist=["GET", "PUT", "PATCH", "DELETE"],
allowed_methods=["GET", "PUT", "PATCH", "DELETE"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

status_forcelist=[429, 500, 502, 503, 504],
backoff_factor=2
)
Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Expand Up @@ -16,9 +16,10 @@ classifiers =
packages = find:
install_requires =
click~=7.0
requests;python_version>='3.6'
requests>=2.25;python_version>='3.6'
# requests dropped python 3.5 support since v2.26
requests<2.26;python_version<'3.6'
requests>=2.25,<2.26;python_version<'3.6'
urllib3>=1.26
junitparser>=2.0.0
setuptools
more_itertools>=7.1.0;python_version>='3.6'
Expand Down
3 changes: 1 addition & 2 deletions tests/test_runners/test_jest.py
Expand Up @@ -73,8 +73,7 @@ def test_subset_split(self):
'jest', input=self.subset_input)

self.assertEqual(result.exit_code, 0)
# to avoid "Using 'method_whitelist'..." warning message
self.assertIn('subset/123', result.output.rstrip("\n"))
self.assertIn('subset/123', result.output)

@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.launchable_token})
Expand Down
9 changes: 3 additions & 6 deletions tests/test_runners/test_minitest.py
Expand Up @@ -71,8 +71,7 @@ def test_subset(self):

self.assertEqual(result.exit_code, 0)
output = Path(self.test_files_dir, "test", "example_test.rb")
# To ignore "Using 'method_whitelist'..." warning message
self.assertIn(str(output), result.output.rstrip("\n"))
self.assertIn(str(output), result.output)

@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.launchable_token})
Expand Down Expand Up @@ -104,8 +103,7 @@ def test_subset_split(self):
'minitest', str(self.test_files_dir) + "/test/**/*.rb")

self.assertEqual(result.exit_code, 0)
# to avoid "Using 'method_whitelist'..." warning message
self.assertIn('subset/123', result.output.rstrip("\n"))
self.assertIn('subset/123', result.output)

@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.launchable_token})
Expand All @@ -121,8 +119,7 @@ def test_split_subset(self):

self.assertEqual(result.exit_code, 0)
output = Path(self.test_files_dir, "test", "example_test.rb")
# To ignore "Using 'method_whitelist'..." warning message
self.assertIn(str(output), result.output.rstrip("\n"))
self.assertEqual(str(output), result.output.rstrip("\n"))
self.assertEqual(rest.read().decode().rstrip("\n"), str(output))
rest.close()
os.unlink(rest.name)
6 changes: 2 additions & 4 deletions tests/test_runners/test_nunit.py
Expand Up @@ -55,8 +55,7 @@ def test_subset(self):
self.assert_json_orderless_equal(expected, payload)

output = 'ParameterizedTests.MyTests.DivideTest(12,3)\ncalc.Tests1.Test1'
# To ignore "Using 'method_whitelist'..." warning message
self.assertIn(output, result.output.rstrip('\n'))
self.assertIn(output, result.output)

@ignore_warnings
@responses.activate
Expand Down Expand Up @@ -95,9 +94,8 @@ def test_split_subset(self):

self.assertEqual(result.exit_code, 0)

# To ignore "Using 'method_whitelist'..." warning message
self.assertIn('ParameterizedTests.MyTests.DivideTest(12,3)',
result.output.rstrip("\n"))
result.output)

self.assertEqual(rest.read().decode(), 'calc.Tests1.Test1')
rest.close()
Expand Down