diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-12-25 23:24:19 -0600 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-12-25 23:24:19 -0600 |
commit | 7beaa66a64c4b29294739b5319664070b862103c (patch) | |
tree | 50334fec0fb79a915a4fd72cb89ffe3fbabcdc4e /test_six.py | |
parent | 54e88aec5f7156dd6dcd440abb5b7e81cdb38ca5 (diff) | |
parent | 1fefc695f8cdb3f317b27171df135af9b683ea12 (diff) | |
download | six-7beaa66a64c4b29294739b5319664070b862103c.tar.gz |
Merged in msabramo/six/issue_34_2 (pull request #24)
Make dir() on six.moves modules return all attributes, despite lazy loading
Diffstat (limited to 'test_six.py')
-rw-r--r-- | test_six.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test_six.py b/test_six.py index 7f92617..13aa6ff 100644 --- a/test_six.py +++ b/test_six.py @@ -99,6 +99,7 @@ def test_move_items(item_name): if item_name.startswith("tkinter") and not have_tkinter: py.test.skip("requires tkinter") raise + assert item_name in dir(six.moves) @py.test.mark.parametrize("item_name", @@ -109,6 +110,8 @@ def test_move_items_urllib_parse(item_name): py.test.skip("ParseResult is only found on 2.5+") if item_name in ("parse_qs", "parse_qsl") and sys.version_info < (2, 6): py.test.skip("parse_qs[l] is new in 2.6") + if sys.version_info[:2] >= (2, 6): + assert item_name in dir(six.moves.urllib.parse) getattr(six.moves.urllib.parse, item_name) @@ -116,6 +119,8 @@ def test_move_items_urllib_parse(item_name): [item.name for item in six._urllib_error_moved_attributes]) def test_move_items_urllib_error(item_name): """Ensure that everything loads correctly.""" + if sys.version_info[:2] >= (2, 6): + assert item_name in dir(six.moves.urllib.error) getattr(six.moves.urllib.error, item_name) @@ -123,6 +128,8 @@ def test_move_items_urllib_error(item_name): [item.name for item in six._urllib_request_moved_attributes]) def test_move_items_urllib_request(item_name): """Ensure that everything loads correctly.""" + if sys.version_info[:2] >= (2, 6): + assert item_name in dir(six.moves.urllib.request) getattr(six.moves.urllib.request, item_name) @@ -130,6 +137,8 @@ def test_move_items_urllib_request(item_name): [item.name for item in six._urllib_response_moved_attributes]) def test_move_items_urllib_response(item_name): """Ensure that everything loads correctly.""" + if sys.version_info[:2] >= (2, 6): + assert item_name in dir(six.moves.urllib.response) getattr(six.moves.urllib.response, item_name) @@ -137,6 +146,8 @@ def test_move_items_urllib_response(item_name): [item.name for item in six._urllib_robotparser_moved_attributes]) def test_move_items_urllib_robotparser(item_name): """Ensure that everything loads correctly.""" + if sys.version_info[:2] >= (2, 6): + assert item_name in dir(six.moves.urllib.robotparser) getattr(six.moves.urllib.robotparser, item_name) |