[AIRFLOW-6699] Parameterize weekday_sensor tests#7315
Closed
coopergillan wants to merge 1 commit into
Closed
Conversation
Using pytest, consolidate the True tests into one parameterized test that uses a master configuration. Also update all tests to use pytest, including regex matching.
1ecb6cb to
42e429c
Compare
mik-laj
reviewed
Jan 31, 2020
| @pytest.mark.parametrize("weekday", TRUE_TESTS_CONFIG.values(), ids=list(TRUE_TESTS_CONFIG.keys())) | ||
| def test_weekday_sensor_true(dag, weekday, tear_down): | ||
| op = DayOfWeekSensor( | ||
| task_id="weekday_sensor_check_true", |
Member
There was a problem hiding this comment.
It is necessary to use classes in tests. More information: https://lists.apache.org/thread.html/1e4df7d4b0cd9b2d2bb76a3336471aa85e852545dd41ada6d4e461b8%40%3Cdev.airflow.apache.org%3E (question 5)
Contributor
Author
There was a problem hiding this comment.
Ah, that makes sense. Thank you for the heads up 👍
Contributor
Author
There was a problem hiding this comment.
This helped me learn about how tests are parameterized here in airflow. Went with a different approach over in #7316.
Contributor
Author
|
Closed in favor of #7316. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using
pytest, consolidate the "True" or "happy path" tests into one parameterized test that uses a new TRUE_TESTS_CONFIG to drive test names and theweek_dayparameter.Update all tests to use
pytest, including regex matching on the failing tests as needed.Issue link: AIRFLOW-6699
Make sure to mark the boxes below before creating PR: [x]
[AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID** For document-only changes commit message can start with
[AIRFLOW-XXXX].In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.