Skip to content

Commit ca62408

Browse files
committed
Add version test
Because we hard-code the version twice, we want to make sure that the VERSION file and the tzdata.__version__ attribute never get out of sync.
1 parent b391458 commit ca62408

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_version.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import os
2+
3+
import tzdata
4+
5+
REPO_ROOT = os.path.split(os.path.split(__file__)[0])[0]
6+
VERSION_FILE = os.path.join(REPO_ROOT, "VERSION")
7+
8+
9+
def test_version():
10+
with open(VERSION_FILE, "rt") as f:
11+
version_from_file = f.read()
12+
13+
assert version_from_file == tzdata.__version__

0 commit comments

Comments
 (0)