Skip to content

Commit

Permalink
[AIRFLOW-XXX] Fix PythonVirtualenvOperator tests (apache#3968)
Browse files Browse the repository at this point in the history
The recent update to the CI image changed the default
python from python2 to python3. The PythonVirtualenvOperator
tests expected python2 as default and fail due to
serialisation errors.
  • Loading branch information
johnhofman authored and odracci committed Jan 6, 2019
1 parent 514cd5e commit 4de3d01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/ci/run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi
if [[ $PYTHON_VERSION == '3' ]]; then
PIP=pip3
else
PIP=pip
PIP=pip2
fi

sudo $PIP install --upgrade pip
Expand Down
3 changes: 2 additions & 1 deletion tests/operators/test_virtualenv_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ def setUp(self):
schedule_interval=INTERVAL)
self.addCleanup(self.dag.clear)

def _run_as_operator(self, fn, **kwargs):
def _run_as_operator(self, fn, python_version=sys.version_info[0], **kwargs):
task = PythonVirtualenvOperator(
python_callable=fn,
python_version=python_version,
task_id='task',
dag=self.dag,
**kwargs)
Expand Down

0 comments on commit 4de3d01

Please sign in to comment.