From 53c65d0ec66872161110696d96b26615d4aaa4ea Mon Sep 17 00:00:00 2001 From: Julius Schlensok Date: Thu, 13 Jun 2024 13:46:50 +0000 Subject: [PATCH] chore: formatting --- tests/unit_tests/test_parquet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_parquet.py b/tests/unit_tests/test_parquet.py index d87f609..ce1209a 100644 --- a/tests/unit_tests/test_parquet.py +++ b/tests/unit_tests/test_parquet.py @@ -7,11 +7,13 @@ import pyarrow.parquet as pq import pytest import scipy + if "typeguard" in sys.modules: from typeguard import suppress_type_checks from spectrum_io.file import parquet + class TestParquet: """Test class to check Parquet file I/O.""" @@ -57,7 +59,7 @@ def test_modify_partition(self, raw_data, tmpdir): def test_write_not_implemented(self, raw_data, tmpdir): """Check whether write_file() raises a NotImplementedError if provided with an unsupported object.""" with pytest.raises(NotImplementedError): - with (suppress_type_checks() if "typeguard" in sys.modules else nullcontext()): + with suppress_type_checks() if "typeguard" in sys.modules else nullcontext(): output_path = Path(tmpdir / "table.parquet") df = pd.DataFrame(raw_data).to_numpy() parquet.write_file(df, output_path) @@ -65,7 +67,7 @@ def test_write_not_implemented(self, raw_data, tmpdir): def test_read_write_partition_not_implemented(self, raw_data, tmpdir): """Check whether write_partition() raises a NotImplementedError if provided with an unsupported object.""" with pytest.raises(NotImplementedError): - with (suppress_type_checks() if "typeguard" in sys.modules else nullcontext()): + with suppress_type_checks() if "typeguard" in sys.modules else nullcontext(): output_path = Path(tmpdir / "partition") df = pd.DataFrame(raw_data).to_numpy() parquet.write_partition([df, df], output_path, ["dataset_1", "dataset_2"])