Skip to content

Commit

Permalink
solar - no engine. Simplified test setUp/tearDown, min args
Browse files Browse the repository at this point in the history
  • Loading branch information
valhuber committed Dec 9, 2020
1 parent 95a3095 commit b43c4a9
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions logic_bank/logic_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class LogicBank:

def activate(session: session, activator: callable):
"""
register SQLAlchemy listeners
load rules - later executed on commit
raises exception if cycles detected
Expand Down
4 changes: 2 additions & 2 deletions nw/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def setUp(test: object, file: str):
print("\n")


def tearDown(file: str, started_at: str, test: object):
def tearDown(test: object, file: str):
"""
close session & engine, banner
Expand All @@ -105,5 +105,5 @@ def tearDown(file: str, started_at: str, test: object):
print("**********************")
print("** Test tearDown complete, SQLAlchemy session/engine closed for: " + file)
print("** Session: " + str(test.session))
print("** Started: " + started_at + " Ended: " + str(datetime.now()))
print("** Started: " + test.started_at + " Ended: " + str(datetime.now()))
print("**********************")
2 changes: 1 addition & 1 deletion nw/tests/test_add_cust.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):
# first delete, so can add
Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_add_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):
pre_cust = self.session.query(models.Customer).filter(models.Customer.Id == "ALFKI").one()
Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_dlt_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):

Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_upd_employee_salary.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):

Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_upd_order_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):

Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_upd_order_required.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):

Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_upd_order_reuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):

Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_upd_order_shipped.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):
self.toggle_order_shipped()
Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_upd_order_shipped_auto_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):
with self.engine.connect().execution_options(autocommit=True) as conn:
Expand Down
2 changes: 1 addition & 1 deletion nw/tests/test_upd_orderclass_required.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self): # banner
pass

def tearDown(self):
tests.tearDown(file=__file__, started_at=self.started_at, test=self)
tests.tearDown(test=self, file=__file__)

def test_run(self):

Expand Down

0 comments on commit b43c4a9

Please sign in to comment.