summaryrefslogtreecommitdiff
path: root/test_six.py
diff options
context:
space:
mode:
authorMarc Abramowitz <marc@marc-abramowitz.com>2013-12-25 14:37:27 -0800
committerMarc Abramowitz <marc@marc-abramowitz.com>2013-12-25 14:37:27 -0800
commitd8af256db43d1157d197658f760fedc69ca91ca9 (patch)
treedbf5f65e9e050cfb909b7548387a73d3a8f8d5f6 /test_six.py
parent6a8540652cc07777eb3770f5dc18709ff1e31344 (diff)
downloadsix-d8af256db43d1157d197658f760fedc69ca91ca9.tar.gz
test_six.py: Don't check dir on python < 2.6
because pythons < 2.6 did not have __dir__ method
Diffstat (limited to 'test_six.py')
-rw-r--r--test_six.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/test_six.py b/test_six.py
index 7b62e53..91dfdf3 100644
--- a/test_six.py
+++ b/test_six.py
@@ -110,7 +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")
- assert item_name in dir(six.moves.urllib.parse)
+ if sys.version_info[:2] >= (2, 6):
+ assert item_name in dir(six.moves.urllib.parse)
getattr(six.moves.urllib.parse, item_name)
@@ -118,7 +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."""
- assert item_name in dir(six.moves.urllib.error)
+ if sys.version_info[:2] >= (2, 6):
+ assert item_name in dir(six.moves.urllib.error)
getattr(six.moves.urllib.error, item_name)
@@ -126,7 +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."""
- assert item_name in dir(six.moves.urllib.request)
+ if sys.version_info[:2] >= (2, 6):
+ assert item_name in dir(six.moves.urllib.request)
getattr(six.moves.urllib.request, item_name)
@@ -134,7 +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."""
- assert item_name in dir(six.moves.urllib.response)
+ if sys.version_info[:2] >= (2, 6):
+ assert item_name in dir(six.moves.urllib.response)
getattr(six.moves.urllib.response, item_name)
@@ -142,7 +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."""
- assert item_name in dir(six.moves.urllib.robotparser)
+ if sys.version_info[:2] >= (2, 6):
+ assert item_name in dir(six.moves.urllib.robotparser)
getattr(six.moves.urllib.robotparser, item_name)