From 58ccb6576fd498b61f2999d855bb19c59498bcd9 Mon Sep 17 00:00:00 2001 From: xuyige Date: Sun, 9 Sep 2018 12:30:33 +0800 Subject: [PATCH] clean up codes --- test/loader/test_loader.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/loader/test_loader.py b/test/loader/test_loader.py index fe826a6f..e5ddc3a6 100644 --- a/test/loader/test_loader.py +++ b/test/loader/test_loader.py @@ -34,18 +34,14 @@ class TestConfigLoader(unittest.TestCase): test_arg = ConfigSection() ConfigLoader("config", "").load_config(os.path.join("./test/loader", "config"), {"test": test_arg}) - #ConfigLoader("config", "").load_config("/home/ygxu/github/fastNLP_testing/fastNLP/test/loader/config", - # {"test": test_arg}) + section = read_section_from_config(os.path.join("./test/loader", "config"), "test") - #dict = read_section_from_config("/home/ygxu/github/fastNLP_testing/fastNLP/test/loader/config", "test") - dict = read_section_from_config(os.path.join("./test/loader", "config"), "test") - - for sec in dict: - if (sec not in test_arg) or (dict[sec] != test_arg[sec]): + for sec in section: + if (sec not in test_arg) or (section[sec] != test_arg[sec]): raise AttributeError("ERROR") for sec in test_arg.__dict__.keys(): - if (sec not in dict) or (dict[sec] != test_arg[sec]): + if (sec not in section) or (section[sec] != test_arg[sec]): raise AttributeError("ERROR") try: