blob: a02625b288a21d22de23749f00590d1226db5c98 [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."""
Philipp Schrader9ebb7062022-12-07 20:17:15 -08009 self.assertEqual(sys.version_info[0:3], (3, 9, 15))
Philipp Schrader9e1b9bd2021-12-28 00:15:12 -080010
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()