-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
106 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
Raises an error at the module level, so no tests can be run | ||
- test: NON-TEST FAIL | ||
- TestSuite.test: NON-TEST FAIL | ||
""" | ||
|
||
import unittest | ||
|
||
x = 5 + "" | ||
|
||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
def test(): | ||
assert add(1, 2) == 3 | ||
assert add(1, 3) == 4 | ||
assert add(1, 4) == 5 | ||
|
||
|
||
class TestSuite(unittest.TestCase): | ||
def test(self): | ||
assert add(1, 2) == 3 | ||
assert add(1, 3) == 4 | ||
assert add(1, 4) == 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
Removes/ replaces functions/ classes so they don't exist when they are called at the test stage | ||
- test_function: NON-TEST FAIL | ||
- TestSuite.test_method: NON-TEST FAIL | ||
- TestSuiteReplace.test_replaced_method: FAIL { "kind": "TypeError", "message": "'int' object is not callable"} | ||
""" | ||
|
||
import unittest | ||
|
||
|
||
def test_function(): | ||
assert True | ||
|
||
|
||
del test_function | ||
|
||
|
||
class TestSuite(unittest.TestCase): | ||
def test_method(self): | ||
assert True | ||
|
||
|
||
del TestSuite | ||
|
||
|
||
class TestSuiteReplace(unittest.TestCase): | ||
def __init__(self): | ||
setattr(self, "test_replaced_method", 5) | ||
|
||
def test_replaced_method(self): | ||
assert True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters