You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
A runnable docstring test...
TODO: fix up the code! so this doesn't throw an assert error!
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
# uncompyle2 bug was not escaping """ properly
|
||||
|
||||
# RUNNABLE!
|
||||
r'''func placeholder - with ("""\nstring\n""")'''
|
||||
def foo():
|
||||
r'''func placeholder - ' and with ("""\nstring\n""")'''
|
||||
@@ -20,3 +22,22 @@ def baz():
|
||||
>>> t.rundict(m1.__dict__, 'rundict_test_pvt') # None are skipped.
|
||||
TestResults(failed=0, attempted=8)
|
||||
"""
|
||||
assert __doc__ == r'''func placeholder - with ("""\nstring\n""")'''
|
||||
assert foo.__doc__ == r'''func placeholder - ' and with ("""\nstring\n""")'''
|
||||
assert bar.__doc__ == r"""func placeholder - ' and with ('''\nstring\n''') and \"\"\"\nstring\n\"\"\" """
|
||||
assert baz.__doc__ == \
|
||||
"""
|
||||
... '''>>> assert 1 == 1
|
||||
... '''
|
||||
... \"""
|
||||
>>> exec test_data in m1.__dict__
|
||||
>>> exec test_data in m2.__dict__
|
||||
>>> m1.__dict__.update({"f2": m2._f, "g2": m2.g, "h2": m2.H})
|
||||
|
||||
Tests that objects outside m1 are excluded:
|
||||
\"""
|
||||
>>> t.rundict(m1.__dict__, 'rundict_test_pvt') # None are skipped.
|
||||
TestResults(failed=0, attempted=8)
|
||||
"""
|
||||
|
||||
baz()
|
||||
|
Reference in New Issue
Block a user