• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Protocol Buffers - Google's data interchange format
2# Copyright 2008 Google Inc.  All rights reserved.
3#
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file or at
6# https://developers.google.com/open-source/licenses/bsd
7"""Test that Kokoro is using the expected version of python."""
8
9import os
10import sys
11import unittest
12
13
14class PythonVersionTest(unittest.TestCase):
15
16  def testPython3(self):
17    """Test that we can import nested import public messages."""
18
19    exp = os.getenv('KOKORO_PYTHON_VERSION', '')
20    if not exp:
21      print('No kokoro python version found, skipping check', file=sys.stderr)
22      return
23    self.assertTrue(
24        sys.version.startswith(exp),
25        'Expected Python %s but found Python %s' % (exp, sys.version))
26
27
28if __name__ == '__main__':
29  unittest.main()
30