| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 """Tests for significantly_different.""" | |
| 3 | |
| 4 import os | |
| 5 import sys | |
| 6 import unittest | |
| 7 | |
| 8 # pylint: disable=relative-import | |
| 9 import significantly_different | |
| 10 | |
| 11 | |
| 12 class SignificantlyDifferentTest(unittest.TestCase): | |
| 13 | |
| 14 def setUp(self): | |
| 15 self.conda_path = None | |
| 16 try: | |
| 17 import scipy # pylint: disable=unused-variable | |
| 18 self.conda_path = sys.executable | |
| 19 except ImportError: | |
| 20 if os.path.exists(os.path.expanduser('~/conda-test/bin/python')): | |
| 21 self.conda_path = os.path.expanduser('~/conda-test/bin/python') | |
| 22 | |
| 23 def test_basic_case(self): | |
| 24 try: | |
| 25 results = significantly_different.main( | |
| 26 ['', '[1, 2, 3, 3, 2, 1]', '[1, 2, 2, 2, 5, 0]', '0.05'], | |
| 27 self.conda_path) | |
| 28 except significantly_different.ScipyNotInstalledError: | |
| 29 # This is meant to let presubmit pass on CQ bots :( because they don't | |
| 30 # have scipy either directly or thorugh anaconda. | |
| 31 return | |
| 32 | |
| 33 self.assertAlmostEqual( | |
| 34 0.40073980338363635, | |
| 35 results['mann_p_value']) | |
| 36 | |
| 37 if __name__ == '__main__': | |
| 38 unittest.main() | |
| OLD | NEW |