File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
15
15
TEST_DIR = Path (__file__ ).resolve ().parent
16
+ CTYPESGEN_DIR = TEST_DIR .parent
16
17
COMMON_DIR = TEST_DIR / "common"
17
18
TMP_DIR = TEST_DIR / "tmp"
18
19
Original file line number Diff line number Diff line change 29
29
import math
30
30
import unittest
31
31
import subprocess
32
+ from pathlib import Path
32
33
from contextlib import (
33
34
redirect_stdout ,
34
35
redirect_stderr ,
44
45
ctypesgen_wrapper ,
45
46
module_from_code ,
46
47
TMP_DIR ,
48
+ CTYPESGEN_DIR ,
47
49
CLEANUP_OK ,
48
50
)
49
51
from . import json_expects
@@ -1064,14 +1066,15 @@ def tearDownClass(cls):
1064
1066
cls .outpath .unlink ()
1065
1067
1066
1068
def test_content (self ):
1069
+ # FIXME the double backslash is actually wrong -- maybe we should remove the R-string prefix, as python seems to auto-escape as necessary
1067
1070
exp_docstring = R"""
1068
1071
Auto-generated by:
1069
1072
ctypesgen.api_main(
1070
1073
{'library': 'c',
1071
- 'output': PosixPath('./tests/tmp/apimain_stdio.py') ,
1074
+ 'output': %s ,
1072
1075
'symbol_rules': ['if_needed=__\\w+'],
1073
1076
'system_headers': ['stdio.h']}
1074
1077
)
1075
- """
1078
+ """ % ( repr ( self . outpath ). replace ( str ( CTYPESGEN_DIR ), "." ), )
1076
1079
self .assertEqual (self .module .__doc__ , exp_docstring )
1077
1080
self .assertTrue (hasattr (self .module , "printf" ))
You can’t perform that action at this time.
0 commit comments