-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
This last line:
LobsterPy/tests/cli/test_cli.py
Line 92 in 2ec4d19
| assert plot_attributes[key] == pytest.approx(ref_value) |
of
LobsterPy/tests/cli/test_cli.py
Lines 72 to 92 in 2ec4d19
| @pytest.mark.parametrize("args", test_cases) | |
| def test_cli_results(self, args, capsys, inject_mocks, clean_plot): | |
| test = get_parser().parse_args(args) | |
| run(test) | |
| captured = capsys.readouterr() | |
| assert captured.out == self.ref_results[" ".join(args)]["stdout"] | |
| plot_attributes = self.get_plot_attributes(plt.gcf()) | |
| ref_plot_attributes = self.ref_results[" ".join(args)]["plot"] | |
| if ref_plot_attributes is None: | |
| assert plot_attributes is None | |
| else: | |
| for key, ref_value in ref_plot_attributes.items(): | |
| if key == "xydata": | |
| for line, ref_line in zip(plot_attributes[key], ref_value): | |
| assert np.array(np.array(line)) == pytest.approx(np.array(ref_line)) | |
| else: | |
| assert plot_attributes[key] == pytest.approx(ref_value) |
Would fail only on MacOS (passed on Ubuntu):
> assert plot_attributes[key] == pytest.approx(ref_value)
E assert [20.0, 12.36] == approx([20.0 ...96 ± 1.2e-05])
E
E comparison failed. Mismatched elements: 1 / 2:
E Max absolute difference: 0.0006797749978968426
E Max relative difference: 5.499797717611995e-05
E Index | Obtained | Expected
E 1 | 12.36 | 12.360679774997896 ± 1.2e-05
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels