diff options
| author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-29 16:47:59 +0200 |
|---|---|---|
| committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-29 16:47:59 +0200 |
| commit | 017d9d3432ae97bdf114ba5937e9f9c7db1e1b8e (patch) | |
| tree | 00f3fa2ea6e8e12c277cc24dcdae427bf36b67c6 | |
| parent | 222a0f04a76af6358f542f559b15913e521f3ec9 (diff) | |
| download | astroid-git-017d9d3432ae97bdf114ba5937e9f9c7db1e1b8e.tar.gz | |
Improve a test, by checking the actual infered objects.
| -rw-r--r-- | astroid/tests/unittest_nodes.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/astroid/tests/unittest_nodes.py b/astroid/tests/unittest_nodes.py index c8b2ee88..c3d7c3e6 100644 --- a/astroid/tests/unittest_nodes.py +++ b/astroid/tests/unittest_nodes.py @@ -25,7 +25,9 @@ import textwrap from astroid.node_classes import unpack_infer from astroid.bases import BUILTINS, InferenceContext from astroid.exceptions import NotFoundError -from astroid import builder, nodes +from astroid import bases +from astroid import builder +from astroid import nodes from astroid import test_utils from astroid.tests import resources @@ -342,6 +344,13 @@ from ..cave import wine\n\n""" handler_type = astroid.body[1].handlers[0].type excs = list(unpack_infer(handler_type)) + # The number of returned object can differ on Python 2 + # and Python 3. In one version, an additional item will + # be returned, from the _pickle module, which is not + # present in the other version. + self.assertIsInstance(excs[0], nodes.Class) + self.assertEqual(excs[0].name, 'PickleError') + self.assertIs(excs[-1], bases.YES) def test_absolute_import(self): astroid = resources.build_file('data/absimport.py') |
