bkyryliuk commented on a change in pull request #11179:
URL:
https://github.com/apache/incubator-superset/pull/11179#discussion_r502661870
##########
File path: tests/alerts_tests.py
##########
@@ -165,41 +148,38 @@ def test_alert_observer(setup_database):
WHERE first = 1
""",
)
- observe(alert8.id, dbsession)
- assert alert8.sql_observer[0].observations[-1].value == 1.0
- assert alert8.sql_observer[0].observations[-1].error_msg is None
+ observe(alert8.id, db_session)
+ assert alert8.observations[-1].value == 1.0
+ assert alert8.observations[-1].error_msg is None
# Test jinja
- alert9 = create_alert(dbsession, "SELECT {{ 2 }}")
- observe(alert9.id, dbsession)
- assert alert9.sql_observer[0].observations[-1].value == 2.0
- assert alert9.sql_observer[0].observations[-1].error_msg is None
+ alert9 = create_alert(db_session, "SELECT {{ 2 }}")
+ observe(alert9.id, db_session)
+ assert alert9.observations[-1].value == 2.0
+ assert alert9.observations[-1].error_msg is None
@patch("superset.tasks.schedules.deliver_alert")
def test_evaluate_alert(mock_deliver_alert, setup_database):
- dbsession = setup_database
+ db_session = setup_database
Review comment:
yes !
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]