blob: 3beff1183c85be73b671f3932da0830dad563e29 [file] [log] [blame]
Philipp Schrader9e1b9bd2021-12-28 00:15:12 -08001import sys
2import unittest
3
4
5class TestPipImports(unittest.TestCase):
6
7 def test_version(self):
8 """Validates that we are using the version specified in rules_python."""
9 self.assertEqual(sys.version_info[0:3], (3, 9, 13))
10
11 def test_imports(self):
12 """Validates that we can import pip packages from pypi.org."""
13 import numpy
14 import scipy
15 import matplotlib
16
17 # Make sure we're sourcing numpy from the expected source. We could
18 # pick any of the three we imported above.
19 self.assertTrue(
20 numpy.__file__.endswith(
21 "/upstream_python_test.runfiles/pip_deps_numpy/site-packages/numpy/__init__.py"
22 ), numpy.__file__)
23
24
25if __name__ == "__main__":
26 unittest.main()