Skip to content

Commit

Permalink
Try to fix mac and windows tests
Browse files Browse the repository at this point in the history
emphasis lies on "Try"
  • Loading branch information
mara004 committed Dec 14, 2023
1 parent bc2c843 commit 7ce489c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/ctypesgentest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def generate(header_str, args=[], lang="py"):
tmp_header = tempfile.NamedTemporaryFile()
tmp_header.write(header_str.encode())
tmp_header.seek(0)
tmp_out = tempfile.NamedTemporaryFile()
tmp_out = tempfile.NamedTemporaryFile(mode="w")
ctypesgen_main(["-i", tmp_header.name, "-o", tmp_out.name, "--output-language", lang, *args])

tmp_header_name = tmp_header.name
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,7 @@ class MacromanEncodeTest(unittest.TestCase):

@classmethod
def setUpClass(cls):
cls.mac_roman_file = "temp_mac.h"
cls.mac_roman_file = TEST_DIR/"temp_mac.h"
mac_header_str = b"""
#define kICHelper "\xa9\\pHelper\xa5"
Expand All @@ -2559,8 +2559,8 @@ def setUpClass(cls):
with open(cls.mac_roman_file, "wb") as mac_file:
mac_file.write(mac_header_str)

header_str = """
#include "temp_mac.h"
header_str = f"""
#include "{cls.mac_roman_file}"
#define MYSTRING kICHelper
Expand Down

0 comments on commit 7ce489c

Please sign in to comment.