Coverage for tests/test_simple.py: 54%
11 statements
« prev ^ index » next coverage.py v6.5.0, created at 2023-03-09 02:55 -0800
« prev ^ index » next coverage.py v6.5.0, created at 2023-03-09 02:55 -0800
1"""
2Very simple tests to show that the test running
3infrastructure can run more than one test file.
4There is nothing scons-specific about these tests.
5"""
7import unittest
8import os
11class SimplestPossibleTestCase(unittest.TestCase):
12 """Tests that don't rely on any external code."""
14 def testSimple(self):
15 self.assertEqual(2 + 2, 4)
17 def testEnvironment(self):
18 """Test the environment. The test will fail if the tests are run
19 by anything other than SCons."""
20 envVar = "XDG_CACHE_HOME"
21 self.assertIn(envVar, os.environ)
22 self.assertTrue(os.path.exists(os.environ[envVar]), f"Check path {os.environ[envVar]}")
25if __name__ == "__main__": 25 ↛ 26line 25 didn't jump to line 26, because the condition on line 25 was never true
26 unittest.main()