You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by fo...@apache.org on 2018/05/24 07:22:44 UTC
incubator-airflow git commit: [AIRFLOW-2473] Fix wrong skip condition
for TransferTests
Repository: incubator-airflow
Updated Branches:
refs/heads/master cedcdb1f8 -> 357e46d27
[AIRFLOW-2473] Fix wrong skip condition for TransferTests
This PR fixes wrong @skipUnlessImported which
decorates
TransferTests and does minor refactoring.
Closes #3411 from sekikn/AIRFLOW-2473
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/357e46d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/357e46d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/357e46d2
Branch: refs/heads/master
Commit: 357e46d27c9a90bba6f22a3dbe07aa5f7bc9146c
Parents: cedcdb1
Author: Kengo Seki <se...@apache.org>
Authored: Thu May 24 09:22:34 2018 +0200
Committer: Fokko Driesprong <fo...@godatadriven.com>
Committed: Thu May 24 09:22:34 2018 +0200
----------------------------------------------------------------------
tests/hooks/test_hive_hook.py | 5 +++--
tests/operators/operators.py | 5 +----
2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/357e46d2/tests/hooks/test_hive_hook.py
----------------------------------------------------------------------
diff --git a/tests/hooks/test_hive_hook.py b/tests/hooks/test_hive_hook.py
index 690b5ad..f1a3b51 100644
--- a/tests/hooks/test_hive_hook.py
+++ b/tests/hooks/test_hive_hook.py
@@ -31,7 +31,8 @@ from hmsclient import HMSClient
from airflow.exceptions import AirflowException
from airflow.hooks.hive_hooks import HiveCliHook, HiveMetastoreHook
-from airflow import DAG, configuration, operators
+from airflow import DAG, configuration
+from airflow.operators.hive_operator import HiveOperator
from airflow.utils import timezone
from airflow.utils.tests import assertEqualIgnoreMultipleSpaces
@@ -70,7 +71,7 @@ class HiveEnvironmentTest(unittest.TestCase):
ADD PARTITION({{ params.partition_by }}='{{ ds }}');
"""
self.hook = HiveMetastoreHook()
- t = operators.hive_operator.HiveOperator(
+ t = HiveOperator(
task_id='HiveHook_' + str(random.randint(1, 10000)),
params={
'database': self.database,
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/357e46d2/tests/operators/operators.py
----------------------------------------------------------------------
diff --git a/tests/operators/operators.py b/tests/operators/operators.py
index f795fd0..4eba0a8 100644
--- a/tests/operators/operators.py
+++ b/tests/operators/operators.py
@@ -256,11 +256,8 @@ class PostgresTest(unittest.TestCase):
assert 'database "foobar" does not exist' in str(e)
-@skipUnlessImported('airflow.operators.hive_operator', 'HiveOperator')
-@skipUnlessImported('airflow.operators.postgres_operator', 'PostgresOperator')
+@skipUnlessImported('airflow.operators.mysql_to_hive', 'MySqlToHiveTransfer')
class TransferTests(unittest.TestCase):
- cluster = None
-
def setUp(self):
configuration.load_test_config()
args = {'owner': 'airflow', 'start_date': DEFAULT_DATE}