MCPcopy Create free account
hub / github.com/pyca/cryptography / tests

Function tests

noxfile.py:35–83  ·  view source on GitHub ↗
(session: nox.Session)

Source from the content-addressed store, hash-verified

33@nox.session(name="tests-randomorder")
34@nox.session(name="tests-nocoverage")
35def tests(session: nox.Session) -> None:
36 extras = "test"
37 if session.name == "tests-ssh":
38 extras += ",ssh"
39 if session.name == "tests-randomorder":
40 extras += ",test-randomorder"
41
42 prof_location = (
43 pathlib.Path(".") / ".rust-cov" / str(uuid.uuid4())
44 ).absolute()
45 if session.name != "tests-nocoverage":
46 session.env.update(
47 {
48 "RUSTFLAGS": "-Cinstrument-coverage "
49 + session.env.get("RUSTFLAGS", ""),
50 "LLVM_PROFILE_FILE": str(prof_location / "cov-%p.profraw"),
51 }
52 )
53
54 install(session, f".[{extras}]")
55 install(session, "-e", "./vectors")
56
57 session.run("pip", "list")
58
59 if session.name != "tests-nocoverage":
60 cov_args = [
61 "--cov=cryptography",
62 "--cov=tests",
63 ]
64 else:
65 cov_args = []
66
67 session.run(
68 "pytest",
69 "-n",
70 "auto",
71 "--dist=worksteal",
72 *cov_args,
73 "--durations=10",
74 *session.posargs,
75 "tests/",
76 )
77
78 if session.name != "tests-nocoverage":
79 [rust_so] = glob.glob(
80 f"{session.virtualenv.location}/**/cryptography/hazmat/bindings/_rust.*",
81 recursive=True,
82 )
83 process_rust_coverage(session, [rust_so], prof_location)
84
85
86@nox.session

Callers

nothing calls this directly

Calls 4

installFunction · 0.85
process_rust_coverageFunction · 0.85
runMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected