diff --git a/test/bytecode_2.7/16_bytestring_docstring.pyc b/test/bytecode_2.7/16_bytestring_docstring.pyc new file mode 100644 index 000000000..0d4114e12 Binary files /dev/null and b/test/bytecode_2.7/16_bytestring_docstring.pyc differ diff --git a/test/bytecode_3.8/16_no_bytestring_docstring.pyc b/test/bytecode_3.8/16_no_bytestring_docstring.pyc new file mode 100644 index 000000000..6d41643df Binary files /dev/null and b/test/bytecode_3.8/16_no_bytestring_docstring.pyc differ diff --git a/test/simple_source/stmts/16_bytestring_docstring.py b/test/simple_source/stmts/16_bytestring_docstring.py new file mode 100644 index 000000000..ab700011c --- /dev/null +++ b/test/simple_source/stmts/16_bytestring_docstring.py @@ -0,0 +1,45 @@ +"""Module docstring""" +class A: + b"""Got \xe7\xfe Bytes?""" + assert __doc__ == b"""Got \xe7\xfe Bytes?""" + + def class_func(self): + b"""Got \xe7\xfe Bytes?""" + assert __doc__ == """Module docstring""" + +class B: + """Got no Bytes?""" + assert __doc__ == """Got no Bytes?""" + + def class_func(self): + """Got no Bytes?""" + assert __doc__ == """Module docstring""" + +def single_func(): + """single docstring?""" + assert __doc__ == """Module docstring""" + +def single_byte_func(): + b"""Got \xe7\xfe Bytes?""" + assert __doc__ == """Module docstring""" + +assert __doc__ == """Module docstring""" + +assert single_func.__doc__ == """single docstring?""" +single_func() + +assert single_byte_func.__doc__ == b"""Got \xe7\xfe Bytes?""" +single_byte_func() + +assert A.__doc__ == b"""Got \xe7\xfe Bytes?""" +assert A.class_func.__doc__ == b"""Got \xe7\xfe Bytes?""" +a = A() +assert a.class_func.__doc__ == b"""Got \xe7\xfe Bytes?""" +a.class_func() + +assert B.__doc__ == """Got no Bytes?""" +assert B.class_func.__doc__ == """Got no Bytes?""" +b = B() +assert b.class_func.__doc__ == """Got no Bytes?""" +b.class_func() + diff --git a/test/simple_source/stmts/16_no_bytestring_docstring.py b/test/simple_source/stmts/16_no_bytestring_docstring.py new file mode 100644 index 000000000..be7167994 --- /dev/null +++ b/test/simple_source/stmts/16_no_bytestring_docstring.py @@ -0,0 +1,45 @@ +"""Module docstring""" +class A: + b"""Got \xe7\xfe Bytes?""" + assert __doc__ == """Module docstring""" + + def class_func(self): + b"""Got \xe7\xfe Bytes?""" + assert __doc__ == """Module docstring""" + +class B: + """Got no Bytes?""" + assert __doc__ == """Got no Bytes?""" + + def class_func(self): + """Got no Bytes?""" + assert __doc__ == """Module docstring""" + +def single_func(): + """single docstring?""" + assert __doc__ == """Module docstring""" + +def single_byte_func(): + b"""Got \xe7\xfe Bytes?""" + assert __doc__ == """Module docstring""" + +assert __doc__ == """Module docstring""" + +assert single_func.__doc__ == """single docstring?""" +single_func() + +assert single_byte_func.__doc__ is None +single_byte_func() + +assert A.__doc__ is None +assert A.class_func.__doc__ is None +a = A() +assert a.class_func.__doc__ is None +a.class_func() + +assert B.__doc__ == """Got no Bytes?""" +assert B.class_func.__doc__ == """Got no Bytes?""" +b = B() +assert b.class_func.__doc__ == """Got no Bytes?""" +b.class_func() +