Skip to content

Commit a5a5304

Browse files
Only set linetrace=True when compiling for coverage
1 parent e2e4b51 commit a5a5304

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
steps:
1717
- name: Acquire sources
1818
uses: actions/checkout@v4
19-
19+
- name: Arm coverage-only compiler directives
20+
run: sed -i 's/#coverage#cython/#cython/g' pkcs11/*.pyx
2021
- name: Setup Python
2122
uses: actions/setup-python@v5
2223
with:

pkcs11/_pkcs11.pxd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,7 @@ cdef inline CK_ULONG_buffer(length):
625625
return array(shape=(length,), itemsize=sizeof(CK_ULONG), format='L')
626626

627627

628-
cdef inline object map_rv_to_error(
629-
CK_RV rv
630-
):
631-
628+
cdef inline object map_rv_to_error(CK_RV rv): # pragma: nocover
632629
if rv == CKR_ATTRIBUTE_TYPE_INVALID:
633630
exc = AttributeTypeInvalid()
634631
elif rv == CKR_ATTRIBUTE_VALUE_INVALID:

pkcs11/_pkcs11.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#!python
21
#cython: language_level=3
3-
#cython: linetrace=True
2+
#coverage#cython: linetrace=True
43
"""
54
High-level Python PKCS#11 Wrapper.
65

0 commit comments

Comments
 (0)