Skip to content
Snippets Groups Projects
Commit 105ee684 authored by patavirt's avatar patavirt
Browse files

Fixup test framework

parent 2370a108
No related branches found
No related tags found
No related merge requests found
......@@ -31,3 +31,8 @@ dependencies = [
test = [
'pytest >= 3'
]
[tool.pytest.ini_options]
filterwarnings = [
'ignore:the imp module is deprecated:DeprecationWarning'
]
# -*- coding:utf-8; eval: (blacken-mode) -*-
import os
import pytest
def pytest_configure(config):
config.addinivalue_line("markers", "slow: mark test as slow to run")
def pytest_addoption(parser):
parser.addoption(
"--slow",
action="store_true",
dest="slow",
default=False,
help="enable slow tests",
)
def pytest_collection_modifyitems(config, items):
if not config.getoption("--slow"):
skip_slow = pytest.mark.skip(reason="need --slow option to run")
for item in items:
if item.get_closest_marker("slow"):
item.add_marker(skip_slow)
# -*- eval: (blacken-mode) -*-
import logging
import pytest
import numpy as np
from numpy.testing import assert_allclose
......@@ -31,9 +32,10 @@ def basic_setup(terminals=False, nx=15, ny=5):
# s.solve(omega=150, maxiter=300, preconditioner="none")
@pytest.mark.slow
def test_solve_dos():
s = basic_setup()
E = np.linspace(-3, 3, 101) + 0.001j
E = np.linspace(-3, 3, 101) + 0.05j
res = s.solve_many(omega=-1j * E)
g = res.G[:, 10, 2, 0, 0]
g_an = -1j * E / np.sqrt(1 - E**2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment