forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move new provider tests to "provider_tests" submodule (apache#45955)
While testing "standard" provider move to the new structure it turned out, that "providers" package used now to keep tests in the new providers is problematic - while it solves the ambiguity of "from celery import", it introduces another ambiguity when trying to import internal utility classes in tests. For example when trying to import BasePythonTest in standard operatori currently we refer to the import from root directory of Airflow:: ``` from providers.tests.standard.operators.test_python ``` However, if we change the package structure to have `providers` as subpackage of `tests` and trying to import it from `tests` as root folder to tests, we have: ``` from providers.standard.operators.test_python ``` And it can ambiguously attempt to import ``` from airflow.providers.standard.operators.test_python ``` This confuses IDEs and attempts to run multiple tests together, because pytest modifies PYTHONPATH while running tests - and PYTHONPATH modification can be different, depending on which tests are selected to run. Changing the sub-package to provider_tests makes it unambiguous and we can now import: ``` from provider_tests.standard.operators.test_python ``` This is unambiguous and allows to import the tests inside the provider package, without importing from root of Airlfow package - making provider package tests "standalone" inside provider.
- Loading branch information
Showing
41 changed files
with
0 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.