diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2021-03-12 09:00:39 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-15 13:10:30 +0100 |
| commit | 775b796d8d13841059850d73986d5dcc2e593077 (patch) | |
| tree | 4995814379868b299cd9ab643cd867b44801554b /tests/utils_tests | |
| parent | 2cd0ccef04767ebfc3f6619f39f5b7dbee9a783b (diff) | |
Refs #32508 -- Raised ValueError instead of using "assert" in lazy().
Diffstat (limited to 'tests/utils_tests')
| -rw-r--r-- | tests/utils_tests/test_functional.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py index 595479a503..b870f98ea2 100644 --- a/tests/utils_tests/test_functional.py +++ b/tests/utils_tests/test_functional.py @@ -224,6 +224,12 @@ class FunctionalTests(SimpleTestCase): lazified() mocked.assert_not_called() + def test_lazy_bytes_and_str_result_classes(self): + lazy_obj = lazy(lambda: 'test', str, bytes) + msg = 'Cannot call lazy() with both bytes and text return types.' + with self.assertRaisesMessage(ValueError, msg): + lazy_obj() + def test_classproperty_getter(self): class Foo: foo_attr = 123 |
