diff options
author | Abhijeet Kasurde <akasurde@redhat.com> | 2024-08-02 08:21:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-02 08:21:08 +0200 |
commit | 207a5fbebba79f348185d6335c82028d175db0df (patch) | |
tree | 94a599810869188d0679219062d92439bd6e5a70 /test/units/utils/test_display.py | |
parent | Remove extraneous get_bin_path call (#83675) (diff) | |
download | ansible-207a5fbebba79f348185d6335c82028d175db0df.tar.xz ansible-207a5fbebba79f348185d6335c82028d175db0df.zip |
test: Handle Singleton Display class (#83673)
Fixes: #83538
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | test/units/utils/test_display.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/units/utils/test_display.py b/test/units/utils/test_display.py index ae7b16bb12..9c2d9c26f6 100644 --- a/test/units/utils/test_display.py +++ b/test/units/utils/test_display.py @@ -54,7 +54,7 @@ def test_get_text_width_no_locale(problematic_wcswidth_chars): pytest.raises(EnvironmentError, get_text_width, problematic_wcswidth_chars[0]) -def test_Display_banner_get_text_width(monkeypatch): +def test_Display_banner_get_text_width(monkeypatch, display_resource): locale.setlocale(locale.LC_ALL, '') display = Display() display_mock = MagicMock() @@ -67,7 +67,7 @@ def test_Display_banner_get_text_width(monkeypatch): assert msg.endswith(stars) -def test_Display_banner_get_text_width_fallback(monkeypatch): +def test_Display_banner_get_text_width_fallback(monkeypatch, display_resource): locale.setlocale(locale.LC_ALL, 'C.UTF-8') display = Display() display_mock = MagicMock() @@ -80,12 +80,12 @@ def test_Display_banner_get_text_width_fallback(monkeypatch): assert msg.endswith(stars) -def test_Display_set_queue_parent(): +def test_Display_set_queue_parent(display_resource): display = Display() pytest.raises(RuntimeError, display.set_queue, 'foo') -def test_Display_set_queue_fork(): +def test_Display_set_queue_fork(display_resource): def test(): display = Display() display.set_queue('foo') @@ -96,7 +96,7 @@ def test_Display_set_queue_fork(): assert p.exitcode == 0 -def test_Display_display_fork(): +def test_Display_display_fork(display_resource): def test(): queue = MagicMock() display = Display() @@ -110,7 +110,7 @@ def test_Display_display_fork(): assert p.exitcode == 0 -def test_Display_display_warn_fork(): +def test_Display_display_warn_fork(display_resource): def test(): queue = MagicMock() display = Display() @@ -124,7 +124,7 @@ def test_Display_display_warn_fork(): assert p.exitcode == 0 -def test_Display_display_lock(monkeypatch): +def test_Display_display_lock(monkeypatch, display_resource): lock = MagicMock() display = Display() monkeypatch.setattr(display, '_lock', lock) @@ -132,7 +132,7 @@ def test_Display_display_lock(monkeypatch): lock.__enter__.assert_called_once_with() -def test_Display_display_lock_fork(monkeypatch): +def test_Display_display_lock_fork(monkeypatch, display_resource): lock = MagicMock() display = Display() monkeypatch.setattr(display, '_lock', lock) |