Because attribute check requires checking if object is not of allowed external type, this tests logic for absence of external module.
()
| 68 | |
| 69 | |
| 70 | def test_external_not_installed(): |
| 71 | """ |
| 72 | Because attribute check requires checking if object is not of allowed |
| 73 | external type, this tests logic for absence of external module. |
| 74 | """ |
| 75 | |
| 76 | class Custom: |
| 77 | def __init__(self): |
| 78 | self.test = 1 |
| 79 | |
| 80 | def __getattr__(self, key): |
| 81 | return key |
| 82 | |
| 83 | with module_not_installed("pandas"): |
| 84 | context = limited(x=Custom()) |
| 85 | with pytest.raises(GuardRejection): |
| 86 | guarded_eval("x.test", context) |
| 87 | |
| 88 | |
| 89 | @dec.skip_without("pandas") |
nothing calls this directly
no test coverage detected
searching dependent graphs…