airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Sakkis (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-867) Tons of unit tests are ignored
Date Sun, 12 Feb 2017 11:33:42 GMT


George Sakkis commented on AIRFLOW-867:

Actually I rushed to blame nosetests; py.test also fails to discover the tests without explicit
imports. It turns out that's because by default they look for modules whose filename starts
with 'test_'. I updated the issue description accordingly. 

> Tons of unit tests are ignored
> ------------------------------
>                 Key: AIRFLOW-867
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: tests
>            Reporter: George Sakkis
>            Priority: Critical
> I was poking around in tests and found out that lots of tests are not discovered by nosetests:
> {noformat}
> $ nosetests -q --collect-only 
> ----------------------------------------------------------------------
> Ran 254 tests in 0.948s
> $ grep -R 'def test' tests/ | wc -l
> 360
> {noformat}
> Initially I thought it might be related to not having installed all extra dependencies
but it turns out it's because apparently nosetests expects explicit import of the related
modules instead of discovering them automatically (like py.test). For example, when adding
an {{from .ti_deps.deps.runnable_exec_date_dep import *}} in {{tests/}} it finds
260 tests, while when commenting out all imports in this module it finds only 15!
> h4. Possible options
> * Quick fix: Add the necessary missing "import *" to discover all current tests.
> * Better fix: Rename all test modules to start with "test_"
>   -Move from nosetests to py.test and get rid of the ugly error-prone 'import *' hack.-

This message was sent by Atlassian JIRA

View raw message