Skip to content

Commit

Permalink
Make tests also patch os.get_terminal_size
Browse files Browse the repository at this point in the history
  • Loading branch information
isidentical committed Apr 14, 2022
1 parent 8a434b1 commit c991b9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_cli_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def fake_terminal_size(*args, **kwargs):
# Setting COLUMNS as an env var is required for 3.8<
monkeypatch.setitem(os.environ, 'COLUMNS', str(PREDEFINED_TERMINAL_SIZE[0]))
monkeypatch.setattr(shutil, 'get_terminal_size', fake_terminal_size)
monkeypatch.setattr(os, 'get_terminal_size', fake_terminal_size)


@pytest.mark.parametrize(
Expand Down
1 change: 1 addition & 0 deletions tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def test_quiet_quiet_with_check_status_non_zero_pipe(self, httpbin):
(['-q'], 1),
(['-qq'], 0),
])
@pytest.mark.xfail("Might fail on Windows due to interference from other warnings.")
def test_quiet_on_python_warnings(self, test_patch, httpbin, flags, expected_warnings):
def warn_and_run(*args, **kwargs):
warnings.warn('warning!!')
Expand Down

0 comments on commit c991b9b

Please sign in to comment.