Skip to content

Commit 1d2b654

Browse files
author
Andres Sanchez
committed
Migrate unit/test_providers_raw_master_key_provider.py from unittest from pytest
1 parent fdb3b5a commit 1d2b654

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/unit/test_providers_raw_master_key_provider.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
"""Test suite for aws_encryption_sdk.key_providers.raw.RawMasterKeyProvider"""
14-
import unittest
15-
1614
import attr
1715
import pytest
1816
import six
@@ -42,16 +40,17 @@ def _get_raw_key(self, key_id):
4240
return self.config.mock_wrapping_key
4341

4442

45-
class TestRawMasterKeyProvider(unittest.TestCase):
43+
class TestRawMasterKeyProvider(object):
4644
def test_parent(self):
4745
assert issubclass(RawMasterKeyProvider, MasterKeyProvider)
4846

4947
def test_get_raw_key_enforcement(self):
5048
class TestProvider(RawMasterKeyProvider):
5149
pass
5250

53-
with six.assertRaisesRegex(self, TypeError, "Can't instantiate abstract class TestProvider *"):
51+
with pytest.raises(TypeError) as excinfo:
5452
TestProvider()
53+
excinfo.match("Can't instantiate abstract class TestProvider *")
5554

5655
@patch(
5756
"aws_encryption_sdk.key_providers.raw.RawMasterKeyConfig", return_value=sentinel.raw_master_key_config_instance

0 commit comments

Comments
 (0)