Skip to content

Commit

Permalink
move run() up to TestCase
Browse files Browse the repository at this point in the history
Checklist:
- Invoke test method 👈🏼
- Invoke setUp first
- Invoke tearDown afterward
- Invoke tearDown even if the test method fails
- Run multiple tests
- Report collected results
  • Loading branch information
kaiosilveira committed Mar 18, 2023
1 parent 5c24e2c commit ffe6c6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ class TestCase:

def __init__(self, name) -> None:
self.name = name

def run(self) -> None:
method = getattr(self, self.name)
method()
4 changes: 0 additions & 4 deletions src/was_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ def __init__(self, name) -> None:

def testMethod(self) -> None:
self.wasRun = 1

def run(self) -> None:
method = getattr(self, self.name)
method()

0 comments on commit ffe6c6f

Please sign in to comment.