From 534f02ecb4d709c7860de88d8d427a810bd159ce Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Tue, 1 Aug 2023 14:08:34 -0400 Subject: [PATCH] move iers pre-fetch to conftest.py from tox.ini (#282) --- conftest.py | 7 +++++++ tox.ini | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/conftest.py b/conftest.py index 290cc21f..d6c72fd5 100644 --- a/conftest.py +++ b/conftest.py @@ -1,3 +1,10 @@ import matplotlib +import pytest matplotlib.use("Agg") + + +def pytest_configure(config): + # pre-cache the IERS file for astropy to prevent downloads + # which will cause errors with remote_data off + from astropy.utils.iers import IERS_Auto; IERS_Auto.open() diff --git a/tox.ini b/tox.ini index 822cc6c6..c8a9fed6 100644 --- a/tox.ini +++ b/tox.ini @@ -15,8 +15,6 @@ setenv = extras = tests commands = pip freeze --all --no-input - # pre-cache the IERS file for astropy to prevent downloads with remote_data off - python -c 'from astropy.utils.iers import IERS_Auto; IERS_Auto.open()' {env:PYTEST_COMMAND} {posargs} description = run tests