Skip to content

Commit 6563578

Browse files
committed
removing warnings, adding markers to tests
1 parent eac6d59 commit 6563578

File tree

10 files changed

+23
-6
lines changed

10 files changed

+23
-6
lines changed

pySDC/projects/node_failure/boussinesq_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def main(ft_strategies):
125125
for k, v in extract_stats.items():
126126
step = k.process
127127
iter = k.iter
128-
if iter is not -1:
128+
if iter != -1:
129129
residual[iter - 1, step] = np.log10(v)
130130

131131
# stats magic: get niter (probably redundant with maxiter)

pySDC/projects/node_failure/grayscott_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def main(ft_strategies):
122122
for k, v in extract_stats.items():
123123
step = k.process
124124
iter = k.iter
125-
if iter is not -1:
125+
if iter != -1:
126126
residual[iter - 1, step] = np.log10(v)
127127

128128
# stats magic: get niter (probably redundant with maxiter)

pySDC/projects/node_failure/hard_faults_detail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def main(ft_setups, ft_strategies):
140140
for k, v in extract_stats.items():
141141
step = k.process
142142
iter = k.iter
143-
if iter is not -1:
143+
if iter != -1:
144144
residual[iter - 1, step] = np.log10(v)
145145
print('')
146146
np.savez('data/' + setup + '_steps_vs_iteration_hf_' + strategy, residual=residual, ft_step=ft.hard_step,

pySDC/tests/test_projects/test_AC/test_simple_forcing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import pytest
12
import subprocess
23
from pySDC.projects.AllenCahn_Bayreuth.run_simple_forcing_verification import main, visualize_radii
34

45
def test_main_serial():
56
main()
67
visualize_radii()
78

9+
@pytest.mark.slow
10+
@pytest.mark.parallel
811
def test_main_parallel():
912

1013
# try to import MPI here, will fail if things go wrong (and not later on in the subprocess part)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
from pySDC.projects.TOMS.AllenCahn_contracting_circle import main
1+
import pytest
22

3+
from pySDC.projects.TOMS.AllenCahn_contracting_circle import main
34

5+
@pytest.mark.slow
46
def test_AllenCahn_contracting_circle():
57
main(cwd='pySDC/projects/TOMS/')
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import pytest
2+
13
from pySDC.projects.Hamiltonian.simple_problems import main
24

5+
@pytest.mark.slow
36
def test_main():
47
main()

pySDC/tests/test_projects/test_parallelSDC/test_preconditioner_MPI.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import os
22
import subprocess
3+
import pytest
34

5+
@pytest.mark.slow
6+
@pytest.mark.parallel
47
def test_preconditioner_playground_MPI_5():
58
# Set python path once
69
my_env = os.environ.copy()
@@ -14,6 +17,8 @@ def test_preconditioner_playground_MPI_5():
1417
(p.returncode, num_procs)
1518

1619

20+
@pytest.mark.slow
21+
@pytest.mark.parallel
1722
def test_preconditioner_playground_MPI_3():
1823
# Set python path once
1924
my_env = os.environ.copy()

pySDC/tests/test_tutorials/test_step_6.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pkg_resources
2+
import pytest
23

34
from pySDC.tutorial.step_6.A_run_non_MPI_controller import main as main_A
45
from pySDC.tutorial.step_6.B_odd_temporal_distribution import main as main_B
@@ -12,6 +13,7 @@ def test_A():
1213
def test_B():
1314
main_B()
1415

16+
@pytest.mark.parallel
1517
def test_C():
1618
installed_packages = [d for d in pkg_resources.working_set]
1719
flat_installed_packages = [package.project_name for package in installed_packages]

pySDC/tests/test_tutorials/test_step_7.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_A():
1313
def test_B():
1414
main_B()
1515

16-
16+
@pytest.mark.parallel
1717
def test_C_1x1():
1818
# try to import MPI here, will fail if things go wrong (and not in the subprocess part)
1919
import mpi4py
@@ -35,7 +35,7 @@ def test_C_1x1():
3535
assert p.returncode == 0, 'ERROR: did not get return code 0, got %s with %2i processes' % \
3636
(p.returncode, num_procs)
3737

38-
38+
@pytest.mark.parallel
3939
def test_C_1x2():
4040
# try to import MPI here, will fail if things go wrong (and not in the subprocess part)
4141
import mpi4py
@@ -56,6 +56,7 @@ def test_C_1x2():
5656
assert p.returncode == 0, 'ERROR: did not get return code 0, got %s with %2i processes' % \
5757
(p.returncode, num_procs)
5858

59+
@pytest.mark.parallel
5960
def test_C_2x2():
6061
# try to import MPI here, will fail if things go wrong (and not in the subprocess part)
6162
import mpi4py

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
markers =
33
fenics: tests relying on FEniCS
44
slow: tests taking much longer than bearable
5+
parallel: tests using MPI parallelism

0 commit comments

Comments
 (0)