You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/01/22 12:05:53 UTC

[airflow] branch master updated: Allows for more than one warning in deprecation message (#13836)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new b1548a2  Allows for more than one warning in deprecation message (#13836)
b1548a2 is described below

commit b1548a2a23d59faa100c45d209f2c2c6f9aaaf03
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Fri Jan 22 13:05:45 2021 +0100

    Allows for more than one warning in deprecation message (#13836)
    
    Sometimes in our tests we get more than one deprecation
    warnings. It is likely caused by transitive warnings
    from importing other external libraries.
    
    In order to get rid of those side effects, we are now
    accepting more than one warning and we expect that at least
    one of the warnings will come from the file being tested
---
 tests/core/test_core_to_contrib.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/core/test_core_to_contrib.py b/tests/core/test_core_to_contrib.py
index 4e6d64b..f7930af 100644
--- a/tests/core/test_core_to_contrib.py
+++ b/tests/core/test_core_to_contrib.py
@@ -82,8 +82,8 @@ class TestMovingCoreToContrib(TestCase):
                 if isinstance(klass, BaseOperator):
                     # In case of operators we are validating that proper stacklevel
                     # is used (=3 or =4 if @apply_defaults)
-                    assert len(warnings) == 1
-                    assert warnings[0].filename == __file__
+                    assert len(warnings) >= 1
+                    assert any(warning.filename == __file__ for warning in warnings)
                 init_mock.assert_called_once_with()
 
     @parameterized.expand(ALL)