Failed test report

Hi,

I ran “ase test” after installation and found that the following tests have failed:
`
=================================== FAILURES ===================================
_______________________________ test_units[2002] _______________________________

version = ‘2002’

@pytest.mark.parametrize('version', sorted(codata_scipy_versions))
def test_units(version):
    name_map = {'_c': 'speed of light in vacuum',
                '_mu0': 'mag. const.',
                '_Grav': 'Newtonian constant of gravitation',
                '_hplanck': 'Planck constant',
                '_e': 'elementary charge',
                '_me': 'electron mass',
                '_mp': 'proton mass',
                '_Nav': 'Avogadro constant',
                '_k': 'Boltzmann constant',
                '_amu': 'atomic mass unit-kilogram relationship'}

    scipy_CODATA = getattr(scipy.constants.codata,
                           f'_physical_constants_{version}', None)
    if version == '2018' and scipy_CODATA is None:
        pytest.skip('No CODATA for 2018 with this scipy')
  assert scipy_CODATA is not None

E assert None is not None

/home/vinayak/.local/lib/python3.8/site-packages/ase/test/test_units.py:35: AssertionError
--------------------------- Captured stdout teardown ---------------------------
Global seed for “test/test_units.py:test_units” was: 10852
_______________________________ test_units[2006] _______________________________

version = ‘2006’

@pytest.mark.parametrize('version', sorted(codata_scipy_versions))
def test_units(version):
    name_map = {'_c': 'speed of light in vacuum',
                '_mu0': 'mag. const.',
                '_Grav': 'Newtonian constant of gravitation',
                '_hplanck': 'Planck constant',
                '_e': 'elementary charge',
                '_me': 'electron mass',
                '_mp': 'proton mass',
                '_Nav': 'Avogadro constant',
                '_k': 'Boltzmann constant',
                '_amu': 'atomic mass unit-kilogram relationship'}

    scipy_CODATA = getattr(scipy.constants.codata,
                           f'_physical_constants_{version}', None)
    if version == '2018' and scipy_CODATA is None:
        pytest.skip('No CODATA for 2018 with this scipy')
  assert scipy_CODATA is not None

E assert None is not None

/home/vinayak/.local/lib/python3.8/site-packages/ase/test/test_units.py:35: AssertionError
--------------------------- Captured stdout teardown ---------------------------
Global seed for “test/test_units.py:test_units” was: 10852
_______________________________ test_units[2010] _______________________________

version = ‘2010’

@pytest.mark.parametrize('version', sorted(codata_scipy_versions))
def test_units(version):
    name_map = {'_c': 'speed of light in vacuum',
                '_mu0': 'mag. const.',
                '_Grav': 'Newtonian constant of gravitation',
                '_hplanck': 'Planck constant',
                '_e': 'elementary charge',
                '_me': 'electron mass',
                '_mp': 'proton mass',
                '_Nav': 'Avogadro constant',
                '_k': 'Boltzmann constant',
                '_amu': 'atomic mass unit-kilogram relationship'}

    scipy_CODATA = getattr(scipy.constants.codata,
                           f'_physical_constants_{version}', None)
    if version == '2018' and scipy_CODATA is None:
        pytest.skip('No CODATA for 2018 with this scipy')
  assert scipy_CODATA is not None

E assert None is not None

/home/vinayak/.local/lib/python3.8/site-packages/ase/test/test_units.py:35: AssertionError
--------------------------- Captured stdout teardown ---------------------------
Global seed for “test/test_units.py:test_units” was: 10852
_______________________________ test_units[2014] _______________________________

version = ‘2014’

@pytest.mark.parametrize('version', sorted(codata_scipy_versions))
def test_units(version):
    name_map = {'_c': 'speed of light in vacuum',
                '_mu0': 'mag. const.',
                '_Grav': 'Newtonian constant of gravitation',
                '_hplanck': 'Planck constant',
                '_e': 'elementary charge',
                '_me': 'electron mass',
                '_mp': 'proton mass',
                '_Nav': 'Avogadro constant',
                '_k': 'Boltzmann constant',
                '_amu': 'atomic mass unit-kilogram relationship'}

    scipy_CODATA = getattr(scipy.constants.codata,
                           f'_physical_constants_{version}', None)
    if version == '2018' and scipy_CODATA is None:
        pytest.skip('No CODATA for 2018 with this scipy')
  assert scipy_CODATA is not None

E assert None is not None

/home/vinayak/.local/lib/python3.8/site-packages/ase/test/test_units.py:35: AssertionError
--------------------------- Captured stdout teardown ---------------------------
Global seed for “test/test_units.py:test_units” was: 10852
=============================== warnings summary ===============================
calculator/dmol/test_Al_dmol.py::test_Al_dmol
/home/vinayak/.local/lib/python3.8/site-packages/_pytest/reports.py:274: ResourceWarning: unclosed file <_io.TextIOWrapper name=‘/dev/null’ mode=‘w’ encoding=‘UTF-8’>
self.user_properties = list(user_properties or [])

forcefields/test_rattle_linear.py::test_rattle_linear
/home/vinayak/.local/lib/python3.8/site-packages/numpy/core/fromnumeric.py:70: ResourceWarning: unclosed file <_io.FileIO name=‘/dev/null’ mode=‘wb’ closefd=True>
passkwargs = {k: v for k, v in kwargs.items()

gui/test_run.py::test_color
/home/vinayak/.local/lib/python3.8/site-packages/ase/gui/ui.py:612: ResourceWarning: unclosed file <_io.TextIOWrapper name=‘/dev/null’ mode=‘w’ encoding=‘UTF-8’>
self.win.bind(‘’, bind(scroll_event))

gui/test_run.py::test_export_graphics[output.eps]
/home/vinayak/.local/lib/python3.8/site-packages/ase/gui/ui.py:536: ResourceWarning: unclosed file <_io.TextIOWrapper name=‘/dev/null’ mode=‘w’ encoding=‘UTF-8’>
def handle(event):

gui/test_run.py::test_reciprocal
/home/vinayak/.local/lib/python3.8/site-packages/_pytest/runner.py:132: ResourceWarning: unclosed file <_io.BufferedReader name=17>
item.funcargs = None # type: ignore[attr-defined]

– Docs: How to capture warnings — pytest documentation
=========================== short test summary info ============================
FAILED test_units.py::test_units[2002] - assert None is not None
FAILED test_units.py::test_units[2006] - assert None is not None
FAILED test_units.py::test_units[2010] - assert None is not None
FAILED test_units.py::test_units[2014] - assert None is not None
= 4 failed, 1688 passed, 263 skipped, 2 xfailed, 2 xpassed, 5 warnings in 164.40s (0:02:44) =
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=‘/dev/null’ mode=‘a’ encoding=‘UTF-8’>
`

Could you tell me what might be the cause and the solution?

Thanks

This was also a doublepost from ASE mailing list where it was answered, IIRC. Please be sure to post links when doubleposting so multiple people don’t spend time answering questions twice!