diff --git a/src/sinol_make/contest_types/default.py b/src/sinol_make/contest_types/default.py index 5480aeaf..5e4a3be3 100644 --- a/src/sinol_make/contest_types/default.py +++ b/src/sinol_make/contest_types/default.py @@ -64,7 +64,7 @@ def get_possible_score(self, groups: List[int], scores: Dict[int, int]) -> int: :param scores: Dictionary: {"": } :return: Maximum possible score. """ - if groups[0] == 0 and len(groups) == 1: + if len(groups) == 0 or (groups[0] == 0 and len(groups) == 1): return 0 possible_score = 0 diff --git a/tests/commands/gen/test_integration.py b/tests/commands/gen/test_integration.py index da8c5fa7..a1bd17a7 100644 --- a/tests/commands/gen/test_integration.py +++ b/tests/commands/gen/test_integration.py @@ -245,7 +245,7 @@ def test_fsanitize(create_package): pytest.skip("-fsanitize=address,undefined is not supported on Apple Silicon") for ingen in ["prog/geningen3.cpp", "prog/geningen4.cpp"]: with pytest.raises(SystemExit) as e: - simple_run([ingen]) + simple_run(["--fsanitize", ingen]) assert e.type == SystemExit assert e.value.code == 1 diff --git a/tests/commands/inwer/test_integration.py b/tests/commands/inwer/test_integration.py index 9beb1297..3135003a 100644 --- a/tests/commands/inwer/test_integration.py +++ b/tests/commands/inwer/test_integration.py @@ -19,12 +19,7 @@ def test_default(capsys, create_package): parser = configure_parsers() args = parser.parse_args(["inwer"]) command = Command() - - with pytest.raises(SystemExit) as e: - command.run(args) - - assert e.type == SystemExit - assert e.value.code == 0 + command.run(args) out = capsys.readouterr().out assert "Verification successful." in out @@ -42,12 +37,7 @@ def test_specified_inwer(capsys, create_package): for inwer_path in ["prog/werinwer.cpp", "prog/werinwer7.cpp"]: args = parser.parse_args(["inwer", inwer_path]) command = Command() - - with pytest.raises(SystemExit) as e: - command.run(args) - - assert e.type == SystemExit - assert e.value.code == 0 + command.run(args) out = capsys.readouterr().out assert "Verification successful." in out @@ -98,12 +88,7 @@ def test_flag_tests(capsys, create_package): parser = configure_parsers() args = parser.parse_args(["inwer", "prog/werinwer.cpp", "--tests", "in/wer2a.in"]) command = Command() - - with pytest.raises(SystemExit) as e: - command.run(args) - - assert e.type == SystemExit - assert e.value.code == 0 + command.run(args) out = capsys.readouterr().out assert "Verification successful." in out @@ -137,10 +122,7 @@ def test_no_output(capsys, create_package): parser = configure_parsers() args = parser.parse_args(["inwer", "prog/werinwer4.cpp"]) command = Command() - - with pytest.raises(SystemExit) as e: - command.run(args) - assert e.value.code == 0 + command.run(args) out = capsys.readouterr().out assert "No output" in out @@ -154,7 +136,7 @@ def test_fsanitize(create_package): pytest.skip("-fsanitize=address,undefined is not supported on Apple Silicon") for inwer in ["prog/werinwer5.cpp", "prog/werinwer6.cpp"]: parser = configure_parsers() - args = parser.parse_args(["inwer", inwer]) + args = parser.parse_args(["inwer", "--fsanitize", inwer]) command = Command() with pytest.raises(SystemExit) as e: command.run(args) diff --git a/tests/test_multiple_arguments.py b/tests/test_multiple_arguments.py index 4a508c70..4607a318 100644 --- a/tests/test_multiple_arguments.py +++ b/tests/test_multiple_arguments.py @@ -21,7 +21,7 @@ def test_simple_package(create_package): @pytest.mark.parametrize("create_package", [util.get_inwer_package_path()], indirect=True) def test_inwer_package(create_package): - run("sinol-make ingen inwer run") + run("sinol-make gen inwer run") run("sinol-make ingen prog/weringen.cpp inwer prog/werinwer.cpp --tests wer1a.in run --tests wer2a.in") run("sinol-make ingen inwer run export --no-statement")