File: conftest.py

package info (click to toggle)
python-service-identity 24.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: python: 1,454; makefile: 146
file content (24 lines) | stat: -rw-r--r-- 539 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import cryptography


try:
    import OpenSSL
    import OpenSSL.SSL
except ImportError:
    OpenSSL = None


def pytest_report_header(config):
    if OpenSSL is not None:
        openssl_version = OpenSSL.SSL.SSLeay_version(
            OpenSSL.SSL.SSLEAY_VERSION
        ).decode("ascii")
        pyopenssl_version = OpenSSL.__version__
    else:
        openssl_version = "n/a"
        pyopenssl_version = "missing"

    return f"""\
OpenSSL: {openssl_version}
pyOpenSSL: {pyopenssl_version}
cryptography: {cryptography.__version__}"""