Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed Jun 3, 2024
1 parent a7ceb92 commit aa11390
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/operators/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@


@pytest.mark.skipif(
sys.version_info != (3, 12),
reason="The error message for the abstract class instantiation seems to have changed between Python 3.11 and 3.12"
(sys.version_info.major, sys.version_info.minor) != (3, 12),
reason="The error message for the abstract class instantiation seems to have changed between Python 3.11 and 3.12",
)
def test_dbt_base_operator_is_abstract():
"""Tests that the abstract base operator cannot be instantiated since the base_cmd is not defined."""
expected_error = (
"Can't instantiate abstract class AbstractDbtBaseOperator with abstract methods base_cmd, build_and_run_cmd"
)
"""
Can't instantiate abstract class AbstractDbtBaseOperator without an implementation for abstract methods 'base_cmd', 'build_and_run_cmd'
"""
with pytest.raises(TypeError, match=expected_error):
AbstractDbtBaseOperator()


@pytest.mark.skipif(
sys.version_info == (3, 12),
reason="The error message for the abstract class instantiation seems to have changed between Python 3.11 and 3.12"
(sys.version_info.major, sys.version_info.minor) == (3, 12),
reason="The error message for the abstract class instantiation seems to have changed between Python 3.11 and 3.12",
)
def test_dbt_base_operator_is_abstract_py12():
"""Tests that the abstract base operator cannot be instantiated since the base_cmd is not defined."""
Expand Down

0 comments on commit aa11390

Please sign in to comment.