Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix coverage
Browse files Browse the repository at this point in the history
zakstucke committed Oct 3, 2023
1 parent 50fad16 commit c443a85
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_colorama.py
Original file line number Diff line number Diff line change
@@ -179,6 +179,16 @@ class Shell:
assert should_colorize(stream) is expected


def test_jupyter_missing_lib(monkeypatch):
# Missing ipykernal so jupyter block will err, should handle gracefully
stream = StreamIsattyFalse()

monkeypatch.setitem(sys.modules, "IPython", MagicMock())
monkeypatch.setattr(sys, "stdout", stream)

assert should_colorize(stream) is False


@pytest.mark.parametrize("patched", ["__stdout__", "__stderr__"])
@pytest.mark.skipif(os.name == "nt", reason="Colorama is required on Windows")
def test_dont_wrap_on_linux(monkeypatch, patched, patch_colorama):

0 comments on commit c443a85

Please sign in to comment.