Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/python | |
|
dtu
2016/02/05 00:18:02
#!/usr/bin/env python
| |
| 2 """Tests for significantly_different.""" | |
| 3 | |
| 4 import os | |
| 5 import unittest | |
| 6 | |
| 7 # pylint: disable=relative-import | |
| 8 import significantly_different | |
| 9 | |
| 10 | |
| 11 class SignificantlyDifferentTest(unittest.TestCase): | |
| 12 | |
| 13 def setUp(self): | |
| 14 self.conda_path = None | |
| 15 try: | |
| 16 import scipy # pylint: disable=unused-variable | |
| 17 self.conda_path = 'python' | |
|
dtu
2016/02/05 00:18:02
sys.executable
| |
| 18 except ImportError: | |
| 19 if os.path.exists(os.path.expanduser('~/conda-test/bin/python')): | |
| 20 self.conda_path = os.path.expanduser('~/conda-test/bin/python') | |
| 21 | |
| 22 def test_basic_case(self): | |
| 23 results = significantly_different.main( | |
| 24 ['', '[1, 2, 3, 3, 2, 1]', '[1, 2, 2, 2, 5, 0]', 0.05], self.conda_path) | |
| 25 self.assertAlmostEqual( | |
| 26 0.40073980338363635, | |
| 27 results['mann_p_value']) | |
| 28 | |
| 29 if __name__ == '__main__': | |
| 30 unittest.main() | |
| OLD | NEW |