aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-02-19 23:38:32 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2019-02-20 12:38:32 +0800
commitac1d13f43dea5ebee0506dc229cd431660916c73 (patch)
tree86b486dd681da2e15017546b4d84956215d56a76 /tests/hazmat
parent91e69f3b47aea16c4cbd0beb9a220b1bb760dfbe (diff)
downloadcryptography-ac1d13f43dea5ebee0506dc229cd431660916c73.tar.gz
cryptography-ac1d13f43dea5ebee0506dc229cd431660916c73.tar.bz2
cryptography-ac1d13f43dea5ebee0506dc229cd431660916c73.zip
Simplify string formatting (#4757)
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/backends/test_openssl_memleak.py2
-rw-r--r--tests/hazmat/primitives/test_dsa.py2
-rw-r--r--tests/hazmat/primitives/test_ec.py6
-rw-r--r--tests/hazmat/primitives/test_rsa.py4
-rw-r--r--tests/hazmat/primitives/test_x963_vectors.py2
-rw-r--r--tests/hazmat/primitives/utils.py4
6 files changed, 10 insertions, 10 deletions
diff --git a/tests/hazmat/backends/test_openssl_memleak.py b/tests/hazmat/backends/test_openssl_memleak.py
index 1db103b5..ed22b5db 100644
--- a/tests/hazmat/backends/test_openssl_memleak.py
+++ b/tests/hazmat/backends/test_openssl_memleak.py
@@ -128,7 +128,7 @@ def assert_no_memory_leaks(s, argv=[]):
env = os.environ.copy()
env["PYTHONPATH"] = os.pathsep.join(sys.path)
argv = [
- sys.executable, "-c", "{0}\n\n{1}".format(s, MEMORY_LEAK_SCRIPT)
+ sys.executable, "-c", "{}\n\n{}".format(s, MEMORY_LEAK_SCRIPT)
] + argv
# Shell out to a fresh Python process because OpenSSL does not allow you to
# install new memory hooks after the first malloc/free occurs.
diff --git a/tests/hazmat/primitives/test_dsa.py b/tests/hazmat/primitives/test_dsa.py
index efd2239c..9e1acf93 100644
--- a/tests/hazmat/primitives/test_dsa.py
+++ b/tests/hazmat/primitives/test_dsa.py
@@ -36,7 +36,7 @@ def _skip_if_dsa_not_supported(backend, algorithm, p, q, g):
not backend.dsa_hash_supported(algorithm)
):
pytest.skip(
- "{0} does not support the provided parameters".format(backend)
+ "{} does not support the provided parameters".format(backend)
)
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py
index 7a6d6aff..1f3a67d3 100644
--- a/tests/hazmat/primitives/test_ec.py
+++ b/tests/hazmat/primitives/test_ec.py
@@ -45,7 +45,7 @@ def _skip_ecdsa_vector(backend, curve_type, hash_type):
curve_type()
):
pytest.skip(
- "ECDSA not supported with this hash {0} and curve {1}".format(
+ "ECDSA not supported with this hash {} and curve {}".format(
hash_type().name, curve_type().name
)
)
@@ -54,7 +54,7 @@ def _skip_ecdsa_vector(backend, curve_type, hash_type):
def _skip_curve_unsupported(backend, curve):
if not backend.elliptic_curve_supported(curve):
pytest.skip(
- "Curve {0} is not supported by this backend {1}".format(
+ "Curve {} is not supported by this backend {}".format(
curve.name, backend
)
)
@@ -65,7 +65,7 @@ def _skip_exchange_algorithm_unsupported(backend, algorithm, curve):
algorithm, curve
):
pytest.skip(
- "Exchange with {0} curve is not supported by {1}".format(
+ "Exchange with {} curve is not supported by {}".format(
curve.name, backend
)
)
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
index 65d88f54..9a0aaf1a 100644
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -89,7 +89,7 @@ def _build_oaep_sha2_vectors():
load_vectors_from_file(
os.path.join(
base_path,
- "oaep-{0}-{1}.txt".format(
+ "oaep-{}-{}.txt".format(
mgf1alg.name, oaepalg.name
)
),
@@ -112,7 +112,7 @@ def _skip_pss_hash_algorithm_unsupported(backend, hash_alg):
)
):
pytest.skip(
- "Does not support {0} in MGF1 using PSS.".format(hash_alg.name)
+ "Does not support {} in MGF1 using PSS.".format(hash_alg.name)
)
diff --git a/tests/hazmat/primitives/test_x963_vectors.py b/tests/hazmat/primitives/test_x963_vectors.py
index 4a945d47..c75afa41 100644
--- a/tests/hazmat/primitives/test_x963_vectors.py
+++ b/tests/hazmat/primitives/test_x963_vectors.py
@@ -21,7 +21,7 @@ from ...utils import load_vectors_from_file, load_x963_vectors
def _skip_hashfn_unsupported(backend, hashfn):
if not backend.hash_supported(hashfn):
pytest.skip(
- "Hash {0} is not supported by this backend {1}".format(
+ "Hash {} is not supported by this backend {}".format(
hashfn.name, backend
)
)
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py
index 811dcf90..4aa5ce71 100644
--- a/tests/hazmat/primitives/utils.py
+++ b/tests/hazmat/primitives/utils.py
@@ -387,13 +387,13 @@ def kbkdf_counter_mode_test(backend, params):
algorithm = supported_algorithms.get(params.get('prf'))
if algorithm is None or not backend.hmac_supported(algorithm()):
- pytest.skip("KBKDF does not support algorithm: {0}".format(
+ pytest.skip("KBKDF does not support algorithm: {}".format(
params.get('prf')
))
ctr_loc = supported_counter_locations.get(params.get("ctrlocation"))
if ctr_loc is None or not isinstance(ctr_loc, CounterLocation):
- pytest.skip("Does not support counter location: {0}".format(
+ pytest.skip("Does not support counter location: {}".format(
params.get('ctrlocation')
))