File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 35
35
# to supply options, put them in 'env', like:
36
36
env :
37
37
CIBW_BEFORE_ALL_LINUX : yum install -y boost-devel zlib-devel
38
+ CIBW_TEST_REQUIRES : pytest
39
+ CIBW_TEST_COMMAND : " pytest --color=yes -v {project}/python/tests/test_pyapproxmc.py"
38
40
CIBW_SKIP : " *musl*"
39
41
CIBW_ARCHS : " auto64"
40
42
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
import sys
3
3
from array import array
4
+ from pathlib import Path
4
5
5
6
import pytest
6
7
@@ -25,7 +26,8 @@ def test_sampling_set():
25
26
def test_real_example ():
26
27
counter = Counter (seed = 120 , epsilon = 0.8 , delta = 0.2 )
27
28
28
- with open ("test_1.cnf" ) as test_cnf :
29
+ cnf_file = Path (__file__ ).parent / "test_1.cnf"
30
+ with open (cnf_file ) as test_cnf :
29
31
# Pop sampling set and metadata lines
30
32
lines = test_cnf .readlines ()[2 :]
31
33
@@ -51,7 +53,8 @@ def test_add_clauses_real_example():
51
53
counter = Counter (seed = 120 , epsilon = 0.8 , delta = 0.2 )
52
54
clauses = []
53
55
54
- with open ("test_1.cnf" ) as test_cnf :
56
+ cnf_file = Path (__file__ ).parent / "test_1.cnf"
57
+ with open ((cnf_file )) as test_cnf :
55
58
# Pop sampling set and metadata lines
56
59
lines = test_cnf .readlines ()[2 :]
57
60
@@ -67,4 +70,5 @@ def test_add_clauses_real_example():
67
70
68
71
69
72
if __name__ == '__main__' :
70
- pytest .main ([__file__ , '-v' ] + sys .argv [1 :])
73
+ ret = pytest .main ([__file__ , '-v' ] + sys .argv [1 :])
74
+ raise SystemExit (ret )
You can’t perform that action at this time.
0 commit comments