Hi all, While reviewing and contributing to Airflow tests, I’ve noticed an inconsistency in how assertions are written. Some tests use `unittest`-style assertions like `mock.assert_called_once_with`, while others use plain `assert` statements in the `pytest` style.
Here's an example of a test using the mixed style: ```python @pytest.mark.parametrize( argnames="conn_id, account_id", argvalues=[(ACCOUNT_ID_CONN, None), (NO_ACCOUNT_ID_CONN, ACCOUNT_ID)], ids=["default_account", "explicit_account"], ) @patch.object(DbtCloudHook, "run") @patch.object(DbtCloudHook, "_paginate") def test_get_account(self, mock_http_run, mock_paginate, conn_id, account_id): hook = DbtCloudHook(conn_id) hook.get_account(account_id=account_id) assert hook.method == "GET" _account_id = account_id or DEFAULT_ACCOUNT_ID hook.run.assert_called_once_with( endpoint=f"api/v2/accounts/{_account_id}/", data=None, extra_options=None ) hook._paginate.assert_not_called() ``` In IDEs and type-checkers (like PyCharm or MyPy), this sometimes causes weak warnings ``` Cannot find reference 'assert_called_once_with' in 'function' ``` This could confuse newcomers or contributors unfamiliar with mocking behavior or type limitations in dynamic typing. To improve clarity and accessibility for contributors—especially those new to the project—I’d like to propose *moving toward consistent use of plain assert statements* for test validations wherever possible. *Proposed Benefits*: - Easier onboarding for first-time contributors - Better IDE support and fewer confusing warnings - More consistent and readable test style across the project I'd love to hear your thoughts on whether this direction makes sense for the project. If agreed, I’d also be happy to help align existing tests gradually. Thanks! Kyungjun Lee