mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 21:20:13 +01:00
tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore. Addresses issue #727.
This commit is contained in:
25
tests/basics/class_staticclassmethod.py
Normal file
25
tests/basics/class_staticclassmethod.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# test static and class methods
|
||||
|
||||
class C:
|
||||
@staticmethod
|
||||
def f(rhs):
|
||||
print('f', rhs)
|
||||
@classmethod
|
||||
def g(self, rhs):
|
||||
print('g', rhs)
|
||||
|
||||
# builtin wrapped in staticmethod
|
||||
@staticmethod
|
||||
def __sub__(rhs):
|
||||
print('sub', rhs)
|
||||
# builtin wrapped in classmethod
|
||||
@classmethod
|
||||
def __add__(self, rhs):
|
||||
print('add', rhs)
|
||||
|
||||
c = C()
|
||||
|
||||
c.f(0)
|
||||
c.g(0)
|
||||
c - 1
|
||||
c + 2
|
||||
Reference in New Issue
Block a user