HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/astropy/constants/tests/test_sciencestate.py
import pytest

import astropy.constants as const
from astropy import astronomical_constants, physical_constants


def test_version_match():
    pversion = physical_constants.get()
    refpversion = const.h.__class__.__name__.lower()
    assert pversion == refpversion
    aversion = astronomical_constants.get()
    refaversion = const.M_sun.__class__.__name__.lower()
    assert aversion == refaversion


def test_previously_imported():
    with pytest.raises(RuntimeError):
        physical_constants.set("codata2018")

    with pytest.raises(RuntimeError):
        astronomical_constants.set("iau2015")