Test getfuncargnames for normal methods
()
| 43 | |
| 44 | |
| 45 | def test_getfuncargnames_methods(): |
| 46 | """Test getfuncargnames for normal methods""" |
| 47 | |
| 48 | class A: |
| 49 | def f(self, arg1, arg2="hello"): |
| 50 | raise NotImplementedError() |
| 51 | |
| 52 | def g(self, /, arg1, arg2="hello"): |
| 53 | raise NotImplementedError() |
| 54 | |
| 55 | def h(self, *, arg1, arg2="hello"): |
| 56 | raise NotImplementedError() |
| 57 | |
| 58 | def j(self, arg1, *, arg2, arg3="hello"): |
| 59 | raise NotImplementedError() |
| 60 | |
| 61 | def k(self, /, arg1, *, arg2, arg3="hello"): |
| 62 | raise NotImplementedError() |
| 63 | |
| 64 | assert getfuncargnames(A().f) == ("arg1",) |
| 65 | assert getfuncargnames(A().g) == ("arg1",) |
| 66 | assert getfuncargnames(A().h) == ("arg1",) |
| 67 | assert getfuncargnames(A().j) == ("arg1", "arg2") |
| 68 | assert getfuncargnames(A().k) == ("arg1", "arg2") |
| 69 | |
| 70 | |
| 71 | def test_getfuncargnames_staticmethod(): |
nothing calls this directly
no test coverage detected