[prev in list] [next in list] [prev in thread] [next in thread] 

List:       avro-commits
Subject:    [avro] 17/23: AVRO-2593: Ensure exfile is Always Defined
From:       rskraba () apache ! org
Date:       2020-01-29 8:54:36
Message-ID: 20200129085420.7F2CA8B6A1 () gitbox ! apache ! org
[Download RAW message or body]

This is an automated email from the ASF dual-hosted git repository.

rskraba pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 8de8fb33d7a14ba276d360db22144178aeaefa34
Author: Michael A. Smith <michael@smith-li.com>
AuthorDate: Sat Oct 19 20:34:45 2019 -0400

    AVRO-2593: Ensure exfile is Always Defined
    
    Fixes a bug where when a test fails the cleanup code tries to access a variable \
                that might not have been defined when the error occurred.
---
 lang/py/test/test_tether_word_count.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lang/py/test/test_tether_word_count.py \
b/lang/py/test/test_tether_word_count.py index cc34f2b..d2f1858 100644
--- a/lang/py/test/test_tether_word_count.py
+++ b/lang/py/test/test_tether_word_count.py
@@ -98,6 +98,7 @@ class TestTetherWordCount(unittest.TestCase):
     import inspect
 
     proc=None
+    exfile = None
 
     try:
 
@@ -207,7 +208,7 @@ python -m avro.tether.tether_task_runner \
word_count_task.WordCountTask  proc.kill()
       if os.path.exists(base_dir):
         shutil.rmtree(base_dir)
-      if os.path.exists(exfile):
+      if exfile is not None and os.path.exists(exfile):
         os.remove(exfile)
 
 if __name__== "__main__":


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic