From 0cb944e06b04d6edb6243ccf7a5f0cb8980264cd Mon Sep 17 00:00:00 2001 From: Felix Soubelet Date: Thu, 5 Dec 2024 16:08:18 +0100 Subject: [PATCH] we skip this test on Windows as pymadng and MADNG are not available there --- tests/test_writer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_writer.py b/tests/test_writer.py index 9d41c995..c8b45e2b 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -1,6 +1,7 @@ import logging import random import string +import sys import numpy as np import pandas as pd @@ -67,7 +68,9 @@ def test_madx_reads_written_tfsdataframes(self, _bigger_tfs_dataframe, tmp_path) # of numpy.array_equal to allow for (very) small relative numerical differences on loading for column in dframe.columns: assert column in madx.table.test_table - assert_series_equal(pd.Series(madx.table.test_table[column]), dframe[column], check_names=False) + assert_series_equal( + pd.Series(madx.table.test_table[column]), dframe[column], check_names=False + ) def test_tfs_write_empty_index_dataframe(self, tmp_path): df = TfsDataFrame( @@ -230,8 +233,10 @@ def test_tfs_write_read_madng_like(self, _tfs_dataframe_madng, tmp_path): new = read_tfs(write_location) assert_tfs_frame_equal(_tfs_dataframe_madng, new, check_exact=False) # float precision can be an issue + @pytest.mark.skipif(sys.platform == "win32", reason="MAD-NG not available on Windows") def test_tfs_write_madng_compatible_is_read_by_madng(self, _tfs_dataframe_madng, tmp_path): from pymadng import MAD + write_location = tmp_path / "test.tfs" write_tfs(write_location, _tfs_dataframe_madng, validate="madng") # has all MAD-NG features assert write_location.is_file() @@ -323,7 +328,8 @@ def test_list_column_dataframe_fails_writes(self, _list_column_in_dataframe: Tfs write_location = tmp_path / "test.tfs" # This df raises in validate because of list colnames with pytest.raises( - IterableInDataFrameError, match="Lists or tuple elements are not accepted in a TfsDataFrame" + IterableInDataFrameError, + match="Lists or tuple elements are not accepted in a TfsDataFrame", ): write_tfs(write_location, list_col_tfs)