Changeset 562


Ignore:
Timestamp:
Nov 20, 2015, 12:34:47 PM (4 years ago)
Author:
cito
Message:

Amend tests to skip over magic methods

These are now part of the dir() because we now use
PyObject_GenericGetAttr() for getting attributes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/TEST_PyGreSQL_classic_connection.py

    r559 r562  
    7878            protocol_version server_version status tty user'''.split()
    7979        connection_attributes = [a for a in dir(self.connection)
    80             if not callable(eval("self.connection." + a))]
     80            if not a.startswith('__')
     81            and not callable(eval("self.connection." + a))]
    8182        self.assertEqual(attributes, connection_attributes)
    8283
     
    8889            set_notice_receiver source transaction'''.split()
    8990        connection_methods = [a for a in dir(self.connection)
    90             if callable(eval("self.connection." + a))]
     91            if not a.startswith('__')
     92            and callable(eval("self.connection." + a))]
    9193        self.assertEqual(methods, connection_methods)
    9294
     
    878880            def notice_receiver(notice):
    879881                for attr in dir(notice):
     882                    if attr.startswith('__'):
     883                        continue
    880884                    value = getattr(notice, attr)
    881885                    if isinstance(value, str):
Note: See TracChangeset for help on using the changeset viewer.