1# Copyright (c) The pyOpenSSL developers 2# See LICENSE for details. 3 4from tempfile import mktemp 5 6import pytest 7 8 9def pytest_report_header(config): 10 import OpenSSL.SSL 11 import cryptography 12 13 return "OpenSSL: {openssl}\ncryptography: {cryptography}".format( 14 openssl=OpenSSL.SSL.SSLeay_version(OpenSSL.SSL.SSLEAY_VERSION), 15 cryptography=cryptography.__version__ 16 ) 17 18 19@pytest.fixture 20def tmpfile(tmpdir): 21 """ 22 Return UTF-8-encoded bytes of a path to a tmp file. 23 24 The file will be cleaned up after the test run. 25 """ 26 return mktemp(dir=tmpdir.dirname).encode("utf-8") 27