Commit aaf14a9
committed
test(fips): make the no-native POST tests genuinely backend-free under -S
The fail-closed tests copy the package, strip every .so, and assert import
refuses crypto. Under an editable install (pip install -e ., as CI runs),
setuptools registers a .pth meta-path finder that maps ama_cryptography.* —
including the compiled Cython bindings — back to the developer build tree, so
the subprocess resolves a working native backend even though the copy under
test has none. The "no native backend" premise was silently false and the
tests were passing for the wrong reason.
Run those subprocesses with -S (skip site processing, so the .pth finder is
never installed). The subprocess then sees only the stripped copy on
PYTHONPATH and the stdlib — a genuinely backend-free tree, which is also what
a real deployment without the C library looks like (the Cython bindings
dynamically link libama_cryptography and cannot load without it). The core
package imports with no third-party dependency (INVARIANT-1), so dropping
site costs these subprocesses nothing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UvSmEE59hFdt3MJHGWzgCJ1 parent 7cf9394 commit aaf14a9
1 file changed
Lines changed: 29 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
68 | 88 | | |
69 | 89 | | |
70 | 90 | | |
71 | 91 | | |
72 | 92 | | |
| 93 | + | |
73 | 94 | | |
74 | | - | |
| 95 | + | |
75 | 96 | | |
76 | 97 | | |
77 | 98 | | |
| |||
126 | 147 | | |
127 | 148 | | |
128 | 149 | | |
| 150 | + | |
129 | 151 | | |
130 | 152 | | |
131 | 153 | | |
| |||
143 | 165 | | |
144 | 166 | | |
145 | 167 | | |
146 | | - | |
| 168 | + | |
147 | 169 | | |
148 | 170 | | |
149 | 171 | | |
| |||
189 | 211 | | |
190 | 212 | | |
191 | 213 | | |
| 214 | + | |
192 | 215 | | |
193 | 216 | | |
194 | 217 | | |
| |||
914 | 937 | | |
915 | 938 | | |
916 | 939 | | |
| 940 | + | |
917 | 941 | | |
918 | 942 | | |
919 | 943 | | |
| |||
942 | 966 | | |
943 | 967 | | |
944 | 968 | | |
| 969 | + | |
945 | 970 | | |
946 | 971 | | |
947 | 972 | | |
| |||
0 commit comments