From 2a4157723a85d9f0700559a31ad0a7a5ea56b219 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 8 May 2018 16:00:59 +0100 Subject: [PATCH] tests: fix breakage from moving is_stdlib_name() --- tests/module_finder_test.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/module_finder_test.py b/tests/module_finder_test.py index 41ebd9ba..c4b65e11 100644 --- a/tests/module_finder_test.py +++ b/tests/module_finder_test.py @@ -22,33 +22,30 @@ class ReprTest(testlib.TestCase): class IsStdlibNameTest(testlib.TestCase): - klass = mitogen.master.ModuleFinder - - def call(self, fullname): - return self.klass().is_stdlib_name(fullname) + func = staticmethod(mitogen.master.is_stdlib_name) def test_builtin(self): import sys - self.assertTrue(self.call('sys')) + self.assertTrue(self.func('sys')) def test_stdlib_1(self): import logging - self.assertTrue(self.call('logging')) + self.assertTrue(self.func('logging')) def test_stdlib_2(self): # virtualenv only symlinks some paths to its local site-packages # directory. Ensure both halves of the search path return the correct # result. import email - self.assertTrue(self.call('email')) + self.assertTrue(self.func('email')) def test_mitogen_core(self): import mitogen.core - self.assertFalse(self.call('mitogen.core')) + self.assertFalse(self.func('mitogen.core')) def test_mitogen_fakessh(self): import mitogen.fakessh - self.assertFalse(self.call('mitogen.fakessh')) + self.assertFalse(self.func('mitogen.fakessh')) class GetModuleViaPkgutilTest(testlib.TestCase):