Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeshpremraj committed Jul 17, 2023
1 parent dee7249 commit 1263781
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ cloudant
cloudbuild
CloudBuildClient
cloudml
cloudpickle
cloudsqldatabehook
CloudTasksClient
Cloudwatch
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ install_requires =
attrs>=22.1.0
blinker
cattrs>=22.1.0
cloudpickle>=2.0.0
# Colorlog 6.x merges TTYColoredFormatter into ColoredFormatter, breaking backwards compatibility with 4.x
# Update CustomTTYColoredFormatter to remove
colorlog>=4.0.2, <5.0
Expand All @@ -83,7 +84,6 @@ install_requires =
cryptography>=0.9.3
deprecated>=1.2.13
dill>=0.2.2
cloudpickle>=2.0.0
# Flask 2.3 is scheduled to introduce a number of deprecation removals - some of them might be breaking
# for our dependencies - notably `_app_ctx_stack` and `_request_ctx_stack` removals.
# We should remove the limitation after 2.3 is released and our dependencies are updated to handle it
Expand Down
10 changes: 5 additions & 5 deletions tests/decorators/test_external_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ def venv_python():


@pytest.fixture()
def venv_python_with_dill():
def venv_python_with_cloudpickle():
with TemporaryDirectory() as d:
venv.create(d, with_pip=True)
python_path = Path(d) / "bin" / "python"
subprocess.call([python_path, "-m", "pip", "install", "dill"])
subprocess.call([python_path, "-m", "pip", "install", "cloudpickle"])
yield python_path


class TestExternalPythonDecorator:
def test_with_dill_works(self, dag_maker, venv_python_with_dill):
@task.external_python(python=venv_python_with_dill, use_cloudpickle=True)
def test_with_cloudpickle_works(self, dag_maker, venv_python_with_cloudpickle):
@task.external_python(python=venv_python_with_cloudpickle, use_cloudpickle=True)
def f():
"""Import cloudpickle to double-check it is installed ."""
import cloudpickle # noqa: F401
import cloudpickle # noqa: F401

with dag_maker():
ret = f()
Expand Down

0 comments on commit 1263781

Please sign in to comment.