Port test suite from nose to pytest.

This just eliminates all errors on the tests collection. Elimination of
failures is left to the next commit.
This commit is contained in:
Matěj Cepl 2020-10-06 07:54:49 +02:00
commit 77dc60ea97
146 changed files with 1172 additions and 1277 deletions

View file

@ -0,0 +1 @@
# This file is intentionally left blank.

View file

@ -4,7 +4,7 @@ import sure # noqa
import zipfile
from botocore.exceptions import ClientError
from moto import mock_cloudformation, mock_iam, mock_lambda, mock_s3, mock_sqs
from nose.tools import assert_raises
import pytest
from string import Template
from uuid import uuid4
@ -109,7 +109,7 @@ def test_lambda_can_be_deleted_by_cloudformation():
# Delete Stack
cf.delete_stack(StackName=stack["StackId"])
# Verify function was deleted
with assert_raises(ClientError) as e:
with pytest.raises(ClientError) as e:
lmbda.get_function(FunctionName=created_fn_name)
e.exception.response["Error"]["Code"].should.equal("ResourceNotFoundException")

View file

@ -24,7 +24,7 @@ from moto import (
mock_sqs,
)
from moto.sts.models import ACCOUNT_ID
from nose.tools import assert_raises
import pytest
from botocore.exceptions import ClientError
_lambda_region = "us-west-2"
@ -497,7 +497,7 @@ def test_get_function():
)
# Test get function when can't find function name
with assert_raises(conn.exceptions.ResourceNotFoundException):
with pytest.raises(conn.exceptions.ResourceNotFoundException):
conn.get_function(FunctionName="junk", Qualifier="$LATEST")
@ -1800,7 +1800,7 @@ def test_get_function_concurrency():
def create_invalid_lambda(role):
conn = boto3.client("lambda", _lambda_region)
zip_content = get_test_zip_file1()
with assert_raises(ClientError) as err:
with pytest.raises(ClientError) as err:
conn.create_function(
FunctionName="testFunction",
Runtime="python2.7",