[pytango] 54/122: Remove temp file in test context

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:18:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

sbodomerle-guest pushed a commit to tag v9.2.1
in repository pytango.

commit 912696f3d01095bf16f06abe6e04108c5e5f9cba
Author: Vincent Michel <vincent.michel at maxlab.lu.se>
Date:   Tue Oct 11 11:12:26 2016 +0200

    Remove temp file in test context
---
 test/context.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/context.py b/test/context.py
index 3318ac7..902c840 100644
--- a/test/context.py
+++ b/test/context.py
@@ -1,6 +1,7 @@
 """Contain the context to run a device without a database."""
 
 # Imports
+import os
 import platform
 import tempfile
 from socket import socket
@@ -70,6 +71,7 @@ class TangoTestContext(object):
         if db is None:
             _, db = tempfile.mkstemp()
         # Attributes
+        self.db = db
         self.port = port
         self.device_name = device_name
         self.server_name = "/".join(("dserver", server_name, instance_name))
@@ -142,6 +144,7 @@ class TangoTestContext(object):
         if self.server:
             self.server.command_inout('Kill')
         self.thread.join(timeout)
+        os.unlink(self.db)
 
     def join(self, timeout=None):
         self.thread.join(timeout)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git



More information about the debian-science-commits mailing list