mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
tests/assert-msg-test: fix opening temporary file in GDB
On Win32, the file cannot be opened a second time, it must be closed first. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
6dcd7fe5e8
commit
52a49eb9c2
@ -146,12 +146,14 @@ class TestAssertMessage(unittest.TestCase):
|
||||
self.skipTest("GDB is not installed, skipping this test!")
|
||||
|
||||
with tempfile.NamedTemporaryFile(
|
||||
prefix="assert-msg-test-", suffix=".gdb", mode="w"
|
||||
prefix="assert-msg-test-", suffix=".gdb", mode="w", delete=False
|
||||
) as tmp:
|
||||
tmp.write(GDB_SCRIPT)
|
||||
tmp.flush()
|
||||
|
||||
result = self.runGdbAssertMessage("-x", tmp.name, self.__assert_msg_test)
|
||||
try:
|
||||
tmp.write(GDB_SCRIPT)
|
||||
tmp.close()
|
||||
result = self.runGdbAssertMessage("-x", tmp.name, self.__assert_msg_test)
|
||||
finally:
|
||||
os.unlink(tmp.name)
|
||||
|
||||
# Some CI environments disable ptrace (as they’re running in a
|
||||
# container). If so, skip the test as there’s nothing we can do.
|
||||
|
Loading…
Reference in New Issue
Block a user