Skip to content

Commit bda6115

Browse files
carmoccarasbt
authored andcommitted
Skip test on 3.8
1 parent eb4623b commit bda6115

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import sys
12
from contextlib import redirect_stdout
23
from io import StringIO
34
from unittest import mock
45

56
import pytest
7+
from packaging.version import Version
68

79

810
def test_cli(tmp_path):
@@ -34,6 +36,10 @@ def test_cli(tmp_path):
3436
assert """--lora_alpha LORA_ALPHA
3537
(type: int, default: 16)""" in out
3638

39+
if Version(f"{sys.version_info.major}.{sys.version_info.minor}") < Version("3.9"):
40+
# python 3.8 prints `Union[int, null]` instead of `Optional[int]`
41+
return
42+
3743
out = StringIO()
3844
with pytest.raises(SystemExit), redirect_stdout(out), mock.patch("sys.argv", ["litgpt", "pretrain", "-h"]):
3945
main()

0 commit comments

Comments
 (0)