forked from protocolbuffers/protobuf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_version_test.py
More file actions
29 lines (22 loc) · 849 Bytes
/
python_version_test.py
File metadata and controls
29 lines (22 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Test that test runner is using the expected version of python."""
import os
import sys
import unittest
class PythonVersionTest(unittest.TestCase):
def testPython3(self):
"""Test that we can import nested import public messages."""
exp = os.getenv('KOKORO_PYTHON_VERSION', '')
if not exp:
print('No system python version found, skipping check', file=sys.stderr)
return
self.assertTrue(
sys.version.startswith(exp),
'Expected Python %s but found Python %s' % (exp, sys.version))
if __name__ == '__main__':
unittest.main()