Commits

Marc Abramowitz committed 692192a

test_six.py: Don't check dir on python < 2.6

because pythons < 2.6 did not have __dir__ method

  • Participants
  • Parent commits cda3266
  • Branches issue_34_2

Comments (0)

Files changed (1)

         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)
 
 
                           [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)
 
 
                           [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)
 
 
                           [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)
 
 
                           [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)