You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the tests on an installed Debian package for version 4.1rc2, test_system_file_used_if_not_expired fails. The failure did not appear during the build time test of the package.
I don't understand what exactly was tested here and so it may be that I should just patch this.
platform linux -- Python 3.8.6rc1, pytest-4.6.11, py-1.9.0, pluggy-0.13.0
rootdir: /tmp/autopkgtest-lxc.qsna6ryk/downtmp/autopkgtest_tmp
plugins: openfiles-0.5.0, remotedata-0.3.2, hypothesis-5.32.1, astropy-header-0.1.2, filter-subpackage-0.1.1, arraydiff-0.3, cov-2.8.1, doctestplus-0.7.0
…
___________ TestDefaultAutoOpen.test_system_file_used_if_not_expired ___________
self = <astropy.utils.iers.tests.test_leap_second.TestDefaultAutoOpen object at 0x7fed36f711c0>
tmpdir = local('/tmp/pytest-of-debci/pytest-0/test_system_file_used_if_not_e0')
@pytest.mark.skipif(not os.path.isfile(SYSTEM_FILE),
reason=f'system does not have {SYSTEM_FILE}')
def test_system_file_used_if_not_expired(self, tmpdir):
# We skip the test if the system file is on a CI and is expired -
# we should not depend on CI keeping it up to date, but if it is,
# we should check that it is used if possible.
if (iers.LeapSeconds.open(SYSTEM_FILE).expires <= self.good_enough):
pytest.skip("System leap second file is expired.")
self.remove_auto_open_files('erfa')
with iers.conf.set_temp('system_leap_second_file', SYSTEM_FILE):
ls = iers.LeapSeconds.open()
assert ls.expires > self.good_enough
assert ls.meta['data_url'] in (iers.IERS_LEAP_SECOND_FILE,
SYSTEM_FILE)
# Also check with a "built-in" file that is expired
fake_file = make_fake_file('28 June 2017', tmpdir)
iers.LeapSeconds._auto_open_files[0] = fake_file
ls2 = iers.LeapSeconds.open()
assert ls2.expires > Time.now()
> assert ls2.meta['data_url'] == SYSTEM_FILE
E AssertionError: assert 'https://hpie...ap_Second.dat' == '/usr/share/zo...-seconds.list'
E - https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat
E + /usr/share/zoneinfo/leap-seconds.list
/usr/lib/python3/dist-packages/astropy/utils/iers/tests/test_leap_second.py:264: AssertionError
Steps to Reproduce
Take the python3-astropy package 4.2rc1 from Debian experimental (should pop up there soon)
install it on a Debian "testing" or "unstable" distribution
@olebole - the test fails if the computer that it is run on has an out-of-date leap-second file, and this is recognized by the fact that in that case the code doesn't use it. So, the file on your machine is likely out of date.
That said, I think this test has only ever given us headaches, well more than is worth it, and I think I should stop hoping that it could be useful in some way!
Description
When running the tests on an installed Debian package for version 4.1rc2,
test_system_file_used_if_not_expired
fails. The failure did not appear during the build time test of the package.I don't understand what exactly was tested here and so it may be that I should just patch this.
Expected behavior
The test succeeds.
Actual behavior
Copied from the test log:
Steps to Reproduce
python3 -m pytest --pyargs astropy
System Details
Linux-5.7.0-3-amd64-x86_64-with-glibc2.29
Python 3.8.6rc1
Numpy 1.19.2
astropy 4.1rc2
Scipy 1.5.2
Matplotlib 3.3.0
The text was updated successfully, but these errors were encountered: