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:
parent
47dbad291e
commit
77dc60ea97
146 changed files with 1172 additions and 1277 deletions
|
|
@ -5,7 +5,7 @@ import json
|
|||
import sure # noqa
|
||||
|
||||
from botocore.exceptions import ClientError
|
||||
from nose.tools import assert_raises
|
||||
import pytest
|
||||
|
||||
from moto import mock_sns, mock_sqs
|
||||
from moto.sns.models import (
|
||||
|
|
@ -293,7 +293,7 @@ def test_creating_subscription_with_attributes():
|
|||
subscriptions.should.have.length_of(0)
|
||||
|
||||
# invalid attr name
|
||||
with assert_raises(ClientError):
|
||||
with pytest.raises(ClientError):
|
||||
conn.subscribe(
|
||||
TopicArn=topic_arn,
|
||||
Protocol="http",
|
||||
|
|
@ -387,17 +387,17 @@ def test_set_subscription_attributes():
|
|||
attrs["Attributes"]["FilterPolicy"].should.equal(filter_policy)
|
||||
|
||||
# not existing subscription
|
||||
with assert_raises(ClientError):
|
||||
with pytest.raises(ClientError):
|
||||
conn.set_subscription_attributes(
|
||||
SubscriptionArn="invalid",
|
||||
AttributeName="RawMessageDelivery",
|
||||
AttributeValue="true",
|
||||
)
|
||||
with assert_raises(ClientError):
|
||||
with pytest.raises(ClientError):
|
||||
attrs = conn.get_subscription_attributes(SubscriptionArn="invalid")
|
||||
|
||||
# invalid attr name
|
||||
with assert_raises(ClientError):
|
||||
with pytest.raises(ClientError):
|
||||
conn.set_subscription_attributes(
|
||||
SubscriptionArn=subscription_arn,
|
||||
AttributeName="InvalidName",
|
||||
|
|
@ -502,7 +502,7 @@ def test_check_opted_out_invalid():
|
|||
conn = boto3.client("sns", region_name="us-east-1")
|
||||
|
||||
# Invalid phone number
|
||||
with assert_raises(ClientError):
|
||||
with pytest.raises(ClientError):
|
||||
conn.check_if_phone_number_is_opted_out(phoneNumber="+44742LALALA")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue