Skip to content

Commit

Permalink
Merge pull request #350 from launchableinc/allowed_methods
Browse files Browse the repository at this point in the history
use allowed_method option instead of method_whitelist
  • Loading branch information
Songmu committed Dec 14, 2021
2 parents d9a1d4d + c22fc75 commit 229b11d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
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"],
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

0 comments on commit 229b11d

Please sign in to comment.