()
| 209 | |
| 210 | |
| 211 | def test_entrypoint_variable(): |
| 212 | icode = r"""Following is the code snippet: |
| 213 | ```python |
| 214 | import numpy as np |
| 215 | from numpy import sin, cos |
| 216 | |
| 217 | SOME_CONSTANT = 5 |
| 218 | |
| 219 | def f(x): |
| 220 | return c(x) |
| 221 | assert f(1) == 5 |
| 222 | def g(x): |
| 223 | return cos(f(x)) |
| 224 | |
| 225 | def c(x): |
| 226 | newObj = h() |
| 227 | return x |
| 228 | |
| 229 | class h(): |
| 230 | def hello_world(): |
| 231 | return SOME_CONSTANT |
| 232 | |
| 233 | def d(x): |
| 234 | return g(x) |
| 235 | |
| 236 | # Some tests |
| 237 | assert g(0) == 1 |
| 238 | print(g(123)) |
| 239 | ret = g(321) |
| 240 | ``` |
| 241 | """ |
| 242 | |
| 243 | assert ( |
| 244 | sanitize(icode, "g") |
| 245 | == r"""import numpy as np |
| 246 | from numpy import sin, cos |
| 247 | SOME_CONSTANT = 5 |
| 248 | def f(x): |
| 249 | return c(x) |
| 250 | def g(x): |
| 251 | return cos(f(x)) |
| 252 | def c(x): |
| 253 | newObj = h() |
| 254 | return x |
| 255 | class h(): |
| 256 | def hello_world(): |
| 257 | return SOME_CONSTANT""" |
| 258 | ) |
nothing calls this directly
no test coverage detected