mirror of
https://github.com/python/cpython.git
synced 2025-07-21 02:05:20 +00:00

This was achieved by: * moving many pass statements in tests onto their own lines, so they pass line coverage and can match an easy ignore pattern if branch coverage is added later. * removing code that cannot be reached. * removing long-disabled tests. * removing unused code. * adding tests for uncovered code It turned out that removing `if __name__ == '__main__'` blocks that run unittest.main() at the bottom of test files was surprisingly contentious, so they remain and can be filtered out with an appropriate .coveragerc.
16 lines
268 B
Python
16 lines
268 B
Python
target = {'foo': 'FOO'}
|
|
|
|
|
|
def is_instance(obj, klass):
|
|
"""Version of is_instance that doesn't access __class__"""
|
|
return issubclass(type(obj), klass)
|
|
|
|
|
|
class SomeClass(object):
|
|
class_attribute = None
|
|
|
|
def wibble(self): pass
|
|
|
|
|
|
class X(object):
|
|
pass
|