html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/4367#issuecomment-733989093,https://api.github.com/repos/pydata/xarray/issues/4367,733989093,MDEyOklzc3VlQ29tbWVudDczMzk4OTA5Mw==,14808389,2020-11-25T23:25:44Z,2020-11-25T23:25:44Z,MEMBER,"This seems to be resolved so I'll close this issue. Feel free to post / reopen if you disagree. Just for reference, both `pytest` and the standard library doctest runner allow running setup code: ```python @pytest.fixture(autouse=True) def custom_function(doctest_namespace): # the name of the function does not matter # add setup code here ... ``` The official way to call the builtin doctest runner seems to be to add a `if __name__ == ""__main__""` with a call to `doctest.testmod()` and to then call the module using either `python .py` or `python -m `. All code before the call to `testmod` can be used to set up the environment of the doctest.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,683954433