when running bazel test Bazel seems to default to Python 2 even when --python-version flag is specified
bazel test //... --python_version PY3
INFO: From Testing //test:py-unit-tests:
==================== Test output for //test:py-unit-tests:
/usr/bin/env: 'python': No such file or directory
This is my BUILD file
py_test(
name = "py-unit-tests",
srcs = glob(["unit/**/*.py"]),
deps = [
],
main = "unit/unit_test_runner.py",
timeout = "short",
)
And the test file
import sys
import unittest
class TestGeneration(unittest.TestCase):
def test_base(self):
pass
def test_urdf(self):
self.assertEqual("hello", 'test')
if __name__ == '__main__':
unittest.main()
Bazel version: 3.3.1
Other notable things:
My system has both py2 and py3 installed
Py3 is located at
/usr/bin/python3Py2 is located at
/usr/bin/python2
There is no /usr/bin/python