-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Portability Pytest 8. Added two tests to check complex assertions
closes #12
- Loading branch information
1 parent
7ef334e
commit 7855c4b
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
test/pytest_parallel_refs/terminal_fail_complex_assert_two_procs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[=]+ test session starts [=]+ | ||
platform [^\n]* | ||
cachedir: [^\n]* | ||
?(?:metadata: [^\n]*)? | ||
rootdir: [^\n]* | ||
?(?:configfile: [^\n]*)? | ||
?(?:plugins: [^\n]*)? | ||
collecting ... [\s]*collected 1 item[\s]* | ||
?(?:Submitting tests to SLURM...)? | ||
?(?:SLURM job [^\n]* has been submitted)? | ||
|
||
[^\n]*test_fail_complex_assert_two_procs.py::test_fail_with_complex_assert_reporting\[2\] FAILED | ||
|
||
[=]+ FAILURES [=]+ | ||
[_]+ test_fail_with_complex_assert_reporting\[2\] [_]+ | ||
|
||
[-]+ On rank 0 of 2 [-]+ | ||
comm = <mpi4py.MPI.Intracomm object at [^\n]*> | ||
|
||
@pytest_parallel.mark.parallel\(2\) | ||
def test_fail_with_complex_assert_reporting\(comm\): | ||
if comm.Get_rank\(\) == 0: | ||
> assert 1 == 0 | ||
E assert 1 == 0 | ||
|
||
[^\n]*test_fail_complex_assert_two_procs.py:7: AssertionError | ||
|
||
[-]+ On rank 1 of 2 [-]+ | ||
comm = <mpi4py.MPI.Intracomm object at [^\n]*> | ||
|
||
@pytest_parallel.mark.parallel\(2\) | ||
def test_fail_with_complex_assert_reporting\(comm\): | ||
if comm.Get_rank\(\) == 0: | ||
assert 1 == 0 | ||
if comm.Get_rank\(\) == 1: | ||
> assert \[0,1,2\] == \[0,1,3\] | ||
E assert \[0, 1, 2\] == \[0, 1, 3\] | ||
E | ||
E At index 2 diff: 2 != 3 | ||
E | ||
E Full diff: | ||
E \[ | ||
E 0, | ||
E 1, | ||
E - 3, | ||
E \? \^ | ||
E \+ 2, | ||
E \? \^ | ||
E \] | ||
|
||
[^\n]*test_fail_complex_assert_two_procs.py:9: AssertionError | ||
[=]+ short test summary info [=]+ | ||
FAILED [^\n]*test_fail_complex_assert_two_procs.py::test_fail_with_complex_assert_reporting\[2\][^\n]* | ||
[=]+ 1 failed in [^\n]*s [=]+ |
9 changes: 9 additions & 0 deletions
9
test/pytest_parallel_tests/test_fail_complex_assert_two_procs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import pytest_parallel | ||
|
||
|
||
@pytest_parallel.mark.parallel(2) | ||
def test_fail_with_complex_assert_reporting(comm): | ||
if comm.Get_rank() == 0: | ||
assert 1 == 0 | ||
if comm.Get_rank() == 1: | ||
assert [0,1,2] == [0,1,3] |