Skip to content

Commit 7f26f1f

Browse files
[TESTING] Minor improvement to test performance.
Changes in file tests/test_basic.py: * class BasicTestSuite now skips some trivial tests unless debug mode is used. * related work
1 parent 5fca83c commit 7f26f1f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/test_basic.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ class BasicTestSuite(context.BasicUsageTestSuite):
6565

6666
__module__ = "tests.test_basic"
6767

68-
@unittest.skipUnless(True, "Insanity Test. Good luck debugging.")
68+
@unittest.skipUnless(__debug__, "Insanity Test. Good luck debugging.")
6969
def test_absolute_truth_and_meaning(self):
7070
"""Insanity Test 1: Because it only matters if we're not mad as hatters."""
7171
assert True
7272

73+
@unittest.skipUnless(__debug__, "Insanity Test. Good luck debugging.")
7374
def test_Does_Pass_WHEN_Meta_Test(self):
7475
"""Insanity Test 2: for unittests assertion."""
7576
self.assertTrue(True) # skipcq: PYL-W1503 - obviously this is an Insanity Test!
@@ -78,6 +79,12 @@ def test_Does_Pass_WHEN_Meta_Test(self):
7879
self.test_absolute_truth_and_meaning()
7980
self.test_None_WHEN_Nothing()
8081

82+
@unittest.skipUnless(__debug__, "Insanity Test. Good luck debugging.")
83+
def test_None_WHEN_Nothing(self):
84+
"""Insanity Test 3: indirect call for unittests assertion."""
85+
self.assertIsNone(None) # skipcq: PYL-W1503 - obviously this is an Insanity Test!
86+
# define new tests below
87+
8188
def test_Does_Pass_WHEN_Using_Import_From_Syntax(self):
8289
"""Test case 0: importing multicast."""
8390
theResult = False
@@ -110,7 +117,7 @@ def test_Error_WHEN_the_help_command_is_called(self):
110117
self.assertTrue(theResult)
111118

112119
def test_IsNone_WHEN_given_corner_case_input(self):
113-
"""Example Test case for bad input directly into function."""
120+
"""Test case 2: Example for bad input directly into function."""
114121
theResult = False
115122
try:
116123
from .context import multicast
@@ -129,11 +136,6 @@ def test_IsNone_WHEN_given_corner_case_input(self):
129136
theResult = False
130137
self.assertTrue(theResult)
131138

132-
def test_None_WHEN_Nothing(self):
133-
"""Try adding new tests."""
134-
self.assertIsNone(None) # skipcq: PYL-W1503 - obviously this is an Insanity Test!
135-
# define new tests below
136-
137139
@unittest.skipUnless(sys.platform.startswith("linux"), "This test example requires linux")
138140
def test_Skip_UNLESS_linux_only(self):
139141
"""Linux is the test."""

0 commit comments

Comments
 (0)