(vars=None)
| 545 | |
| 546 | @contextlib.contextmanager |
| 547 | def assert_loads(vars=None): |
| 548 | if vars is None: |
| 549 | vars = expected |
| 550 | with self.roundtrip(expected) as actual: |
| 551 | for k, v in actual.variables.items(): |
| 552 | # IndexVariables are eagerly loaded into memory |
| 553 | assert v._in_memory == (k in actual.dims) |
| 554 | yield actual |
| 555 | for k, v in actual.variables.items(): |
| 556 | if k in vars: |
| 557 | assert v._in_memory |
| 558 | assert_identical(expected, actual) |
| 559 | |
| 560 | with pytest.raises(AssertionError): |
| 561 | # make sure the contextmanager works! |
nothing calls this directly
no test coverage detected