File: conftest.py

package info (click to toggle)
python-ase 3.26.0-2
  • 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 (45 lines) | stat: -rw-r--r-- 938 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# fmt: off
import pytest

from ase.calculators.genericfileio import BaseProfile, CalculatorTemplate


@pytest.fixture(autouse=True)
def _calculator_tests_always_use_testdir(testdir):
    pass


class DummyProfile(BaseProfile):
    def get_calculator_command(self, inputfile):
        if not inputfile:
            return []
        return [inputfile]

    def version(self):
        return "0.0.0"


class DummyTemplate(CalculatorTemplate):

    def __init__(self):
        super().__init__(
            name="dummy",
            implemented_properties=()
        )

    def write_input(self, directory, atoms, parameters, properties):
        pass

    def load_profile(self, cfg, **kwargs):
        return DummyProfile.from_config(cfg, self.name, **kwargs)

    def execute(self, directory, profile):
        pass

    def read_results(self, directory):
        pass


@pytest.fixture()
def dummy_template():
    return DummyTemplate()