File: test_versionnumber.py

package info (click to toggle)
python-ase 3.26.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (19 lines) | stat: -rw-r--r-- 604 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# fmt: off
from importlib.metadata import PackageNotFoundError, version

import pytest

import ase


def test_versionnumber():
    # Check that the version number reported by importlib matches
    # what is hardcoded in ase/__init__.py
    try:
        version_seen_by_python = version('ase')
    except PackageNotFoundError:
        pytest.skip('ASE not visible to importlib.metadata')
    else:
        assert ase.__version__ == version_seen_by_python, (
            f'ASE is version {ase.__version__} but python thinks it is '
            f'{version_seen_by_python} - perhaps rerun "pip install -e"')