Skip to content

Commit

Permalink
fix dags test action
Browse files Browse the repository at this point in the history
  • Loading branch information
bibliotechy committed Aug 4, 2023
1 parent 7afa804 commit faaeac0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/dags_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,21 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/requirements.txt
pip install -r dags/requirements.txt
pip check
- name: Lint with Flake8
- name: Lint dags with ruff
run: |
pip install flake8
flake8 dags --benchmark -v
- name: Confirm Black code compliance
run: |
pip install black
black dags -v
pip install ruff
ruff check --format=github ./dags
- name: Test with Pytest
run: |
pip install pytest
cd tests || exit
pip install pytest apache-airflow
cd dags || exit
pytest tests.py -v
5 changes: 2 additions & 3 deletions dags/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from airflow.models import DagBag

from . import rikolti_harvest_collection_dag as harvest_dag

DAGS_FOLDER = "."

Expand All @@ -11,5 +10,5 @@ class HarvestDagsTest(TestCase):
def dag_bag(self):
return DagBag(dag_folder=DAGS_FOLDER, include_examples=False)

def test_no_import_errors(dag_bag):
assert not dag_bag.import_errors
def test_no_import_errors(self):
assert not self.dag_bag.import_errors

0 comments on commit faaeac0

Please sign in to comment.