Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
  • Loading branch information
klecki committed Jan 18, 2024
1 parent 65ff42c commit 767b142
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions dali/test/python/test_pipeline_decorator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,8 +13,9 @@
# limitations under the License.

from nvidia.dali import Pipeline, pipeline_def
from nvidia.dali.pipeline import do_not_convert
from nose.tools import nottest
from nose_utils import raises
from nose_utils import raises, assert_raises
import nvidia.dali.fn as fn
from test_utils import get_dali_extra_path, compare_pipelines
import os
Expand Down Expand Up @@ -143,3 +144,23 @@ def pipe_conf():
assert getattr(pipe, "_is_pipeline_def", False)
assert getattr(pipe_unconf, "_is_pipeline_def", False)
assert getattr(pipe_conf, "_is_pipeline_def", False)


def test_pipeline_def_with_do_not_convert():
with assert_raises(
ValueError, glob="Pipeline definition cannot be marked with @do_not_convert."
):

@pipeline_def
@do_not_convert
def pipe():
return 42

with assert_raises(
ValueError, glob="Pipeline definition cannot be marked with @do_not_convert."
):

@do_not_convert
@pipeline_def
def pipe():
return 42

0 comments on commit 767b142

Please sign in to comment.