Skip to content

Commit

Permalink
Refs #7079 -- added basic scaffholding for benchmarks (#7087)
Browse files Browse the repository at this point in the history
As it turns out, pytest-benchmark does basically what we want so there's not much to this.
  • Loading branch information
alex committed Apr 19, 2022
1 parent 3b9a11b commit 496703c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ line-length = 79
target-version = ["py36"]

[tool.pytest.ini_options]
addopts = "-r s --capture=no --strict-markers"
addopts = "-r s --capture=no --strict-markers --benchmark-disable"
markers = [
"skip_fips: this test is not executed in FIPS mode",
"supported: parametrized test requiring only_if and skip_message",
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ exclude =
[options.extras_require]
test =
pytest>=6.2.0
pytest-benchmark
pytest-cov
pytest-subtests
pytest-xdist
Expand Down
15 changes: 15 additions & 0 deletions tests/bench/test_x509.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.

from cryptography import x509


def test_aki_public_bytes(benchmark):
aki = x509.AuthorityKeyIdentifier(
key_identifier=b"\x00" * 16,
authority_cert_issuer=None,
authority_cert_serial_number=None,
)
benchmark(aki.public_bytes)

0 comments on commit 496703c

Please sign in to comment.