Skip to content

Commit 4dda6ba

Browse files
authored
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.
1 parent a1d24cf commit 4dda6ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+0
-0
lines changed
File renamed without changes.

providers/airbyte/tests/providers/airbyte/__init__.py renamed to providers/airbyte/tests/provider_tests/airbyte/__init__.py

File renamed without changes.

providers/airbyte/tests/providers/airbyte/hooks/__init__.py renamed to providers/airbyte/tests/provider_tests/airbyte/hooks/__init__.py

File renamed without changes.

providers/airbyte/tests/providers/airbyte/hooks/test_airbyte.py renamed to providers/airbyte/tests/provider_tests/airbyte/hooks/test_airbyte.py

File renamed without changes.

providers/airbyte/tests/providers/airbyte/operators/__init__.py renamed to providers/airbyte/tests/provider_tests/airbyte/operators/__init__.py

File renamed without changes.

providers/airbyte/tests/providers/airbyte/operators/test_airbyte.py renamed to providers/airbyte/tests/provider_tests/airbyte/operators/test_airbyte.py

File renamed without changes.

providers/airbyte/tests/providers/airbyte/sensors/__init__.py renamed to providers/airbyte/tests/provider_tests/airbyte/sensors/__init__.py

File renamed without changes.

providers/airbyte/tests/providers/airbyte/sensors/test_airbyte.py renamed to providers/airbyte/tests/provider_tests/airbyte/sensors/test_airbyte.py

File renamed without changes.

providers/airbyte/tests/providers/airbyte/triggers/__init__.py renamed to providers/airbyte/tests/provider_tests/airbyte/triggers/__init__.py

File renamed without changes.

providers/airbyte/tests/providers/airbyte/triggers/test_airbyte.py renamed to providers/airbyte/tests/provider_tests/airbyte/triggers/test_airbyte.py

File renamed without changes.

0 commit comments

Comments
 (0)