diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-12-20 22:59:02 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-12-20 23:42:05 -0600 |
commit | a620b7dfc15cf945a589e9d472b01db6f48a50a5 (patch) | |
tree | 91e304fd6bbdfaa8ecc42bfa68da6fda37f963f6 /tests/hazmat/primitives/utils.py | |
parent | 9b9318d79ba5927603b120411d13b607938cae56 (diff) | |
download | cryptography-a620b7dfc15cf945a589e9d472b01db6f48a50a5.tar.gz cryptography-a620b7dfc15cf945a589e9d472b01db6f48a50a5.tar.bz2 cryptography-a620b7dfc15cf945a589e9d472b01db6f48a50a5.zip |
don't modify params on parametrized tests
multiple backends receive the same params dicts, but we were modifying
them using pop.
Diffstat (limited to 'tests/hazmat/primitives/utils.py')
-rw-r--r-- | tests/hazmat/primitives/utils.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py index 758e755c..227a4055 100644 --- a/tests/hazmat/primitives/utils.py +++ b/tests/hazmat/primitives/utils.py @@ -44,8 +44,8 @@ def encrypt_test(backend, cipher_factory, mode_factory, params, only_if, skip_message): if not only_if(backend): pytest.skip(skip_message) - plaintext = params.pop("plaintext") - ciphertext = params.pop("ciphertext") + plaintext = params["plaintext"] + ciphertext = params["ciphertext"] cipher = Cipher( cipher_factory(**params), mode_factory(**params), @@ -84,9 +84,9 @@ def aead_test(backend, cipher_factory, mode_factory, params, only_if, if not only_if(backend): pytest.skip(skip_message) if params.get("pt") is not None: - plaintext = params.pop("pt") - ciphertext = params.pop("ct") - aad = params.pop("aad") + plaintext = params["pt"] + ciphertext = params["ct"] + aad = params["aad"] if params.get("fail") is True: cipher = Cipher( cipher_factory(binascii.unhexlify(params["key"])), @@ -145,9 +145,9 @@ def stream_encryption_test(backend, cipher_factory, params, only_if, skip_message): if not only_if(backend): pytest.skip(skip_message) - plaintext = params.pop("plaintext") - ciphertext = params.pop("ciphertext") - offset = params.pop("offset") + plaintext = params["plaintext"] + ciphertext = params["ciphertext"] + offset = params["offset"] cipher = Cipher(cipher_factory(**params), None, backend=backend) encryptor = cipher.encryptor() # throw away offset bytes |