From 4be8afa3d3cb31a934211c822e5a972477c2b29b Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 24 Jun 2018 20:10:32 +0100 Subject: [PATCH] issue #275: tests: fix test_simple for 2.6. --- tests/module_finder_test.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tests/module_finder_test.py b/tests/module_finder_test.py index 1c77bdee..c2e64cfb 100644 --- a/tests/module_finder_test.py +++ b/tests/module_finder_test.py @@ -1,4 +1,5 @@ import inspect +import sys import unittest2 @@ -190,19 +191,24 @@ class FindRelatedTest(testlib.TestCase): def call(self, fullname): return self.klass().find_related(fullname) + SIMPLE_EXPECT = set([ + 'mitogen', + 'mitogen.compat', + 'mitogen.compat.collections', + 'mitogen.compat.functools', + 'mitogen.core', + 'mitogen.master', + 'mitogen.minify', + 'mitogen.parent', + ]) + + if sys.version_info < (2, 7): + SIMPLE_EXPECT.add('mitogen.compat.tokenize') + def test_simple(self): import mitogen.fakessh related = self.call('mitogen.fakessh') - self.assertEquals(related, [ - 'mitogen', - 'mitogen.compat', - 'mitogen.compat.collections', - 'mitogen.compat.functools', - 'mitogen.core', - 'mitogen.master', - 'mitogen.minify', - 'mitogen.parent', - ]) + self.assertEquals(set(related), self.SIMPLE_EXPECT) def test_django_pkg(self): import django