()
| 90 | |
| 91 | |
| 92 | def test_code_getargs() -> None: |
| 93 | def f1(x): |
| 94 | raise NotImplementedError() |
| 95 | |
| 96 | c1 = Code.from_function(f1) |
| 97 | assert c1.getargs(var=True) == ("x",) |
| 98 | |
| 99 | def f2(x, *y): |
| 100 | raise NotImplementedError() |
| 101 | |
| 102 | c2 = Code.from_function(f2) |
| 103 | assert c2.getargs(var=True) == ("x", "y") |
| 104 | |
| 105 | def f3(x, **z): |
| 106 | raise NotImplementedError() |
| 107 | |
| 108 | c3 = Code.from_function(f3) |
| 109 | assert c3.getargs(var=True) == ("x", "z") |
| 110 | |
| 111 | def f4(x, *y, **z): |
| 112 | raise NotImplementedError() |
| 113 | |
| 114 | c4 = Code.from_function(f4) |
| 115 | assert c4.getargs(var=True) == ("x", "y", "z") |
| 116 | |
| 117 | |
| 118 | def test_frame_getargs() -> None: |
nothing calls this directly
no test coverage detected