blob: 366624ebcad279e5c9ebe9864983fc15cdb661a5 [file] [log] [blame]
Hynek Schlawackf9182e22016-03-14 13:51:16 +01001# Copyright (c) The pyOpenSSL developers
2# See LICENSE for details.
3
Alex Chan6b69c552016-10-24 16:34:41 +01004from tempfile import mktemp
5
6import pytest
7
Hynek Schlawackf9182e22016-03-14 13:51:16 +01008
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 )
Alex Chan6b69c552016-10-24 16:34:41 +010017
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")