Skip to content

Commit 9868b1a

Browse files
authored
Merge pull request #2741 from pre-commit/golang-1-20
fix golang version regex in test
2 parents c2e432c + d216cdd commit 9868b1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/languages/golang_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import annotations
22

3-
import re
43
from unittest import mock
54

65
import pytest
6+
import re_assert
77

88
import pre_commit.constants as C
99
from pre_commit.languages import golang
@@ -40,4 +40,4 @@ def test_golang_infer_go_version_default():
4040
version = ACTUAL_INFER_GO_VERSION(C.DEFAULT)
4141

4242
assert version != C.DEFAULT
43-
assert re.match(r'^\d+\.\d+\.\d+$', version)
43+
re_assert.Matches(r'^\d+\.\d+(?:\.\d+)?$').assert_matches(version)

0 commit comments

Comments
 (0)