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

fix: Fix regression test cases in Python 3.9 #3183

Merged
merged 8 commits into from
Aug 19, 2021
8 changes: 8 additions & 0 deletions tests/regression/package/regression_package_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import boto3

from samcli.yamlhelper import yaml_parse

S3_SLEEP = 3
TIMEOUT = 300

Expand Down Expand Up @@ -108,8 +110,14 @@ def regression_check(self, args):
self.assertEqual(process.returncode, 0)
output_aws = output_template_file_aws.read()

# remove the region name from the template url in cases like nested stacks
output_aws = output_aws.replace(b"s3.us-east-1.", b"s3.")

if "use_json" in args and args.get("use_json"):
output_sam = json.loads(output_sam)
output_aws = json.loads(output_aws)
else:
output_sam = yaml_parse(output_sam)
output_aws = yaml_parse(output_aws)

self.assertEqual(output_sam, output_aws)