File: test_flakes.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (22 lines) | stat: -rw-r--r-- 528 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from pathlib import Path
import pytest
import ase
from ase.test.lint import run_flaketest


def have_documentation():
    ase_path = Path(ase.__path__[0])
    doc_path = ase_path.parent / 'doc/ase/ase.rst'
    return doc_path.is_file()


@pytest.mark.slow
@pytest.mark.lint
def test_flake8():
    pytest.importorskip('flake8')
    if not have_documentation():
        pytest.skip('ase/doc not present; '
                    'this is probably an installed version ')

    errmsg = run_flaketest()
    assert errmsg == '', errmsg