MCPcopy
hub / github.com/scrapy/scrapy / test_pformat_no_pygments

Function test_pformat_no_pygments

tests/test_utils_display.py:75–87  ·  view source on GitHub ↗
(isatty)

Source from the content-addressed store, hash-verified

73@mock.patch("sys.platform", "linux")
74@mock.patch("sys.stdout.isatty")
75def test_pformat_no_pygments(isatty):
76 isatty.return_value = True
77
78 real_import = builtins.__import__
79
80 def mock_import(name, globals_, locals_, fromlist, level):
81 if "pygments" in name:
82 raise ImportError
83 return real_import(name, globals_, locals_, fromlist, level)
84
85 builtins.__import__ = mock_import
86 assert pformat(value) == plain_string
87 builtins.__import__ = real_import
88
89
90def test_pprint():

Callers

nothing calls this directly

Calls 1

pformatFunction · 0.90

Tested by

no test coverage detected