Skip to content

Commit c99d952

Browse files
abdihakim92x1jrdh
authored andcommitted
Fixed the failing test by matching Django’s actual exception type.
1 parent b779b1d commit c99d952

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/unit/metrics/interfaces/management/test_seed_random.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from unittest import mock
55

66
import pytest
7+
from django.core.management.base import CommandError
78
from django.core.management import CommandParser
89

910
from metrics.interfaces.management.commands.seed_random import Command, SCALE_CONFIGS
@@ -343,5 +344,5 @@ def test_add_arguments_rejects_invalid_dataset_value():
343344
parser = CommandParser(prog="manage.py seed_random")
344345
Command().add_arguments(parser)
345346

346-
with pytest.raises(SystemExit):
347+
with pytest.raises(CommandError):
347348
parser.parse_args(["--dataset", "invalid"])

0 commit comments

Comments
 (0)