| 1 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 2 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 |
import subprocess |
| 5 |
import sys |
| 6 |
|
| 7 |
import pytest |
| 8 |
|
| 9 |
from pymbd.benchmark import parse |
| 10 |
|
| 11 |
|
| 12 |
@pytest.mark.parametrize( |
| 13 |
'args', [[], ['--finite'], ['--method=ts']], ids=lambda x: ' '.join(x) |
| 14 |
) |
| 15 |
@pytest.mark.no_scalapack |
| 16 |
def test_benchmark(args): |
| 17 |
stdout = subprocess.run( |
| 18 |
[sys.executable, '-u', '-m', 'pymbd.benchmark', *args], |
| 19 |
check=True, |
| 20 |
stdout=subprocess.PIPE, |
| 21 |
).stdout.decode() |
| 22 |
assert parse(stdout)['energy'] |