tests/conftest.py
717 B · 33 lines · python Raw
1 """Pytest fixtures."""
2
3 from __future__ import annotations
4
5 import pytest
6
7
8 @pytest.fixture
9 def scan_tmpdir(tmp_path):
10 """A temp directory that tests can populate with files then scan."""
11 return tmp_path
12
13
14 @pytest.fixture
15 def sample_python_rsa():
16 return (
17 "from cryptography.hazmat.primitives.asymmetric import rsa\n"
18 "key = rsa.generate_private_key(public_exponent=65537, key_size=2048)\n"
19 )
20
21
22 @pytest.fixture
23 def sample_python_ecdsa():
24 return (
25 "from cryptography.hazmat.primitives.asymmetric import ec\n"
26 "key = ec.generate_private_key(ec.SECP256R1())\n"
27 )
28
29
30 @pytest.fixture
31 def sample_python_clean():
32 return "def hello():\n return 'pqc-safe code'\n"
33