Skip to content

Commit ffe6c6f

Browse files
committed
move run() up to TestCase
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
1 parent 5c24e2c commit ffe6c6f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test_case.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ class TestCase:
22

33
def __init__(self, name) -> None:
44
self.name = name
5+
6+
def run(self) -> None:
7+
method = getattr(self, self.name)
8+
method()

src/was_run.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ def __init__(self, name) -> None:
88

99
def testMethod(self) -> None:
1010
self.wasRun = 1
11-
12-
def run(self) -> None:
13-
method = getattr(self, self.name)
14-
method()

0 commit comments

Comments
 (0)