Skip to content

Instantly share code, notes, and snippets.

@ranggakd
Last active June 8, 2023 09:24

Revisions

  1. ranggakd revised this gist Jun 8, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion skipping_test_soft_fail_unless.py
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,4 @@ def test_case_1(self):

    def test_case_2(self):
    if not platform.startswith("win"):
    raise EnvironmentError("Do not run unless on Windows")
    self.fail("Do not run unless on Windows")
  2. ranggakd created this gist Jun 7, 2023.
    10 changes: 10 additions & 0 deletions skipping_test_soft_fail_unless.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    import unittest
    from sys import platform

    class TestDemo(unittest.TestCase):
    def test_case_1(self):
    self.assertEqual(1+1, 2)

    def test_case_2(self):
    if not platform.startswith("win"):
    raise EnvironmentError("Do not run unless on Windows")