From 606078cabb24ddf1e2cb29175e6d7deae73f5749 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 3 Apr 2018 11:39:59 +0200 Subject: Global variables are evil. Tests under both py2k and py3k pass. --- test/test_wlp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/test_wlp.py') diff --git a/test/test_wlp.py b/test/test_wlp.py index 430c235..929fb1c 100755 --- a/test/test_wlp.py +++ b/test/test_wlp.py @@ -1,5 +1,4 @@ #!/usr/bin/python -# -*- coding: utf-8 -*- import unittest import wlp_parser @@ -97,8 +96,8 @@ class TestWLP(unittest.TestCase): self.assertEqual(tree, expected_tree) def test_wlp(self): - wlp.setfilebyname('examples/whitelist.example') - wl_dict = wlp.mkdict() + with open('examples/whitelist.example') as inf: + wl_dict = wlp.mkdict(inf) self.assertEqual(wl_dict, EXPECTED_WL) -- cgit