Skip to content

Commit

Permalink
tests/cpydiff/: Improve wording, add more workarounds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Sokolovsky committed Jul 9, 2017
1 parent ad5e7a0 commit 0c5369a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/cpydiff/modules_sys_stdassign.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
categories: Modules,sys
description: Override sys.stdin, sys.stdout and sys.stderr. Impossible as they are stored in read-only memory.
cause: Unknown
description: Overriding sys.stdin, sys.stdout and sys.stderr not possible
cause: They are stored in read-only memory.
workaround: Unknown
"""
import sys
Expand Down
4 changes: 2 additions & 2 deletions tests/cpydiff/types_bytes_keywords.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
categories: Types,bytes
description: bytes(...) with keywords not implemented
description: bytes() with keywords not implemented
cause: Unknown
workaround: Input the encoding format directly. eg. ``print(bytes('abc', 'utf-8'))``
workaround: Pass the encoding as a positional paramter, e.g. ``print(bytes('abc', 'utf-8'))``
"""
print(bytes('abc', encoding='utf8'))
6 changes: 3 additions & 3 deletions tests/cpydiff/types_bytes_subscrstep.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
categories: Types,bytes
description: Bytes subscr with step != 1 not implemented
cause: Unknown
workaround: Unknown
description: Bytes subscription with step != 1 not implemented
cause: MicroPython is highly optimized for memory usage.
workaround: Use explicit loop for this very rare operation.
"""
print(b'123'[0:3:2])
6 changes: 3 additions & 3 deletions tests/cpydiff/types_exception_instancevar.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
categories: Types,Exception
description: Assign instance variable to exception
cause: Unknown
workaround: Unknown
description: User-defined attributes for builtin exceptions are not supported
cause: MicroPython is highly optimized for memory usage.
workaround: Use user-defined exception subclasses.
"""
e = Exception()
e.x = 0
Expand Down
4 changes: 2 additions & 2 deletions tests/cpydiff/types_exception_loops.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
categories: Types,Exception
description: While loop guards will obscure exception line number reporting due to being optimised onto the end of the code block
cause: Unknown
description: Exception in while loop condition may have unexpected line number
cause: Condition checks are optimized to happen at the end of loop body, and that line number is reported.
workaround: Unknown
"""
l = ["-foo", "-bar"]
Expand Down
2 changes: 1 addition & 1 deletion tests/cpydiff/types_float_rounding.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
categories: Types,float
description: uPy and CPython outputs formats differ
description: uPy and CPython outputs formats may differ
cause: Unknown
workaround: Unknown
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/cpydiff/types_int_subclassconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
categories: Types,int
description: No int conversion for int-derived types available
cause: Unknown
workaround: Unknown
workaround: Avoid subclassing builtin types unless really needed. Prefer https://en.wikipedia.org/wiki/Composition_over_inheritance .
"""
class A(int):
__add__ = lambda self, other: A(int(self) + other)
Expand Down
2 changes: 1 addition & 1 deletion tests/cpydiff/types_list_delete_subscrstep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
categories: Types,list
description: List delete with step != 1 not implemented
cause: Unknown
workaround: Unknown
workaround: Use explicit loop for this rare operation.
"""
l = [1, 2, 3, 4]
del l[0:4:2]
Expand Down
2 changes: 1 addition & 1 deletion tests/cpydiff/types_list_store_subscrstep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
categories: Types,list
description: List store with step != 1 not implemented
cause: Unknown
workaround: Unknown
workaround: Use explicit loop for this rare operation.
"""
l = [1, 2, 3, 4]
l[0:4:2] = [5, 6]
Expand Down

0 comments on commit 0c5369a

Please sign in to comment.