From ec4c25c7f2ccbfe52c69df7d35dffc2f07291fa8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 14:55:55 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_lhe_reader.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/test_lhe_reader.py b/tests/test_lhe_reader.py index 1b9c609e..2fd6c1b2 100644 --- a/tests/test_lhe_reader.py +++ b/tests/test_lhe_reader.py @@ -12,9 +12,14 @@ TEST_FILE_LHE_v1 = skhep_testdata.data_path("pylhe-testfile-pr29.lhe") TEST_FILE_LHE_v3 = skhep_testdata.data_path("pylhe-testlhef3.lhe") -TEST_FILE_LHE_INITRWGT_WEIGHTS = skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-hvq.lhe") -TEST_FILE_LHE_RWGT_WGT= skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-W.lhe") -TEST_FILES_LHE_POWHEG = [skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-%s.lhe"%(proc)) for proc in ["Z", "W", "Zj", "trijet","directphoton", "hvq"]] +TEST_FILE_LHE_INITRWGT_WEIGHTS = skhep_testdata.data_path( + "pylhe-testfile-powheg-box-v2-hvq.lhe" +) +TEST_FILE_LHE_RWGT_WGT = skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-W.lhe") +TEST_FILES_LHE_POWHEG = [ + skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-%s.lhe" % (proc)) + for proc in ["Z", "W", "Zj", "trijet", "directphoton", "hvq"] +] @pytest.fixture(scope="session") @@ -138,7 +143,7 @@ def test_read_lhe_with_attributes_v3(): assert isinstance(e, LHEEvent) -@pytest.mark.parametrize('file', TEST_FILES_LHE_POWHEG) +@pytest.mark.parametrize("file", TEST_FILES_LHE_POWHEG) def test_read_lhe_powheg(file): """ Test method read_lhe() on a LesHouchesEvents POWHEG file. @@ -149,7 +154,8 @@ def test_read_lhe_powheg(file): for e in events: assert isinstance(e, LHEEvent) -@pytest.mark.parametrize('file', TEST_FILES_LHE_POWHEG) + +@pytest.mark.parametrize("file", TEST_FILES_LHE_POWHEG) def test_read_lhe_with_attributes_powheg(file): """ Test method read_lhe_with_attributes() on a LesHouchesEvents POWHEG file. @@ -160,7 +166,8 @@ def test_read_lhe_with_attributes_powheg(file): for e in events: assert isinstance(e, LHEEvent) -@pytest.mark.parametrize('file', TEST_FILES_LHE_POWHEG) + +@pytest.mark.parametrize("file", TEST_FILES_LHE_POWHEG) def test_read_lhe_powheg(file): """ Test method read_lhe() on a LesHouchesEvents POWHEG file. @@ -171,9 +178,9 @@ def test_read_lhe_powheg(file): for e in events: assert isinstance(e, LHEEvent) + def test_read_lhe_initrwgt_weights_v3(): - """ - """ + """ """ events = pylhe.read_lhe_with_attributes(TEST_FILE_LHE_INITRWGT_WEIGHTS) assert events @@ -181,9 +188,9 @@ def test_read_lhe_initrwgt_weights_v3(): assert isinstance(e, LHEEvent) assert len(e.weights) > 0 + def test_read_lhe_rwgt_wgt_v3(): - """ - """ + """ """ events = pylhe.read_lhe_with_attributes(TEST_FILE_LHE_RWGT_WGT) assert events @@ -191,6 +198,7 @@ def test_read_lhe_rwgt_wgt_v3(): assert isinstance(e, LHEEvent) assert len(e.weights) > 0 + def test_issue_102(): """ Test a file containing lines starting with "#aMCatNLO".