nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: pallets/click
Pull request #2100 (2021-10-12 10:56:42)

Allow a callable default to have its own string representation
As it was before 78a62b37c956e71b32689a0d5c75a684aa9ab56d.

A callable can also be an object with `__call__` and `__str__` defined, in which case it makes sense to use it. Don't try too hard to show something else instead, because the developer most likely knows what he (or she) is doing.

Fixes https://github.com/pallets/click/issues/2099


Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index 92f69dc..cfc9280 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -9,6 +9,8 @@ Unreleased
     same as the string ``"-"``. :issue:`2106`
 -   The ``option`` and ``argument`` decorators preserve the type
     annotation of the decorated function. :pr:`2155`
+-   A callable default value can customize its help text by overriding
+    ``__str__`` instead of always showing ``(dynamic)``. :issue:`2099`
 
 
 Version 8.0.3
diff --git a/src/click/core.py b/src/click/core.py
index 09d9c21..6d8cace 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1,5 +1,6 @@
 import enum
 import errno
+import inspect
 import os
 import sys
 import typing as t
@@ -2719,7 +2720,7 @@ class Option(Parameter):
                 default_string = f"({self.show_default})"
             elif isinstance(default_value, (list, tuple)):
                 default_string = ", ".join(str(d) for d in default_value)
-            elif callable(default_value):
+            elif inspect.isfunction(default_value):
                 default_string = _("(dynamic)")
             elif self.is_bool_flag and self.secondary_opts:
                 # For boolean flags that have distinct True/False opts,


Test patch:
diff --git a/tests/test_options.py b/tests/test_options.py
index 2e34337..90616b7 100644
--- a/tests/test_options.py
+++ b/tests/test_options.py
@@ -305,6 +305,19 @@ def test_dynamic_default_help_text(runner):
     assert "(current user)" in result.output
 
 
+def test_dynamic_default_help_special_method(runner):
+    class Value:
+        def __call__(self):
+            return 42
+
+        def __str__(self):
+            return "special value"
+
+    opt = click.Option(["-a"], default=Value(), show_default=True)
+    ctx = click.Context(click.Command("cli"))
+    assert "special value" in opt.get_help_record(ctx)[1]
+
+
 @pytest.mark.parametrize(
     ("type", "expect"),
     [
Repository: pallets/click
Pull request #2724 (2024-05-20 15:58:34)

Fix printing of default option value to handle empty strings
Added an explicit check for the default value being an empty string to ensure that the default is displayed.

Fixes https://github.com/pallets/click/issues/2500
<!--
Ensure each step in CONTRIBUTING.rst is complete, especially the following:

- Add tests that demonstrate the correct behavior of the change. Tests
  should fail without the change.
- Add or update relevant docs, in the docs folder and in code.
- Add an entry in CHANGES.rst summarizing the change and linking to the issue.
- Add `.. versionchanged::` entries in any relevant code docs.
-->



Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index aba1bbe..f298cee 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,8 @@ Unreleased
 -   Fix an issue with type hints for ``click.open_file()``. :issue:`2717`
 -   Fix issue where error message for invalid ``click.Path`` displays on
     multiple lines. :issue:`2697`
+-   Fixed issue that prevented a default value of ``""`` from being displayed in
+    the help for an option. :issue:`2500`
 
 
 Version 8.1.7
diff --git a/src/click/core.py b/src/click/core.py
index f205c79..367beb2 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -2804,6 +2804,8 @@ class Option(Parameter):
                 )[1]
             elif self.is_bool_flag and not self.secondary_opts and not default_value:
                 default_string = ""
+            elif default_value == "":
+                default_string = '""'
             else:
                 default_string = str(default_value)
 


Test patch:
diff --git a/tests/test_options.py b/tests/test_options.py
index 91249b2..7397f36 100644
--- a/tests/test_options.py
+++ b/tests/test_options.py
@@ -786,6 +786,14 @@ def test_show_default_string(runner):
     assert "[default: (unlimited)]" in message
 
 
+def test_show_default_with_empty_string(runner):
+    """When show_default is True and default is set to an empty string."""
+    opt = click.Option(["--limit"], default="", show_default=True)
+    ctx = click.Context(click.Command("cli"))
+    message = opt.get_help_record(ctx)[1]
+    assert '[default: ""]' in message
+
+
 def test_do_not_show_no_default(runner):
     """When show_default is True and no default is set do not show None."""
     opt = click.Option(["--limit"], show_default=True)
Repository: pallets/click
Pull request #661 (2016-09-23 08:35:58)

Don't suggest to run application under Python 2
This message is invalid for Python 3 only apps. I know that developers
should do their own error handling, but this error could confusing
to users where such error handling was not done.


Patch:
diff --git a/CHANGES b/CHANGES
index 658c479..565eefe 100644
--- a/CHANGES
+++ b/CHANGES
@@ -11,7 +11,6 @@ Version 6.7
 - Make `click.progressbar` work with `codecs.open` files. See #637.
 - Fix bug in bash completion with nested subcommands. See #639.
 - Fix test runner not saving caller env correctly. See #644.
-- Fix handling of SIGPIPE. See #626
 
 Version 6.6
 -----------
diff --git a/click/_unicodefun.py b/click/_unicodefun.py
index 24b7031..9e17a38 100644
--- a/click/_unicodefun.py
+++ b/click/_unicodefun.py
@@ -114,6 +114,5 @@ def _verify_python3_env():
 
     raise RuntimeError('Click will abort further execution because Python 3 '
                        'was configured to use ASCII as encoding for the '
-                       'environment.  Either run this under Python 2 or '
-                       'consult http://click.pocoo.org/python3/ for '
-                       'mitigation steps.' + extra)
+                       'environment.  Consult http://click.pocoo.org/python3/'
+                       'for mitigation steps.' + extra)
diff --git a/click/core.py b/click/core.py
index 7456451..33a527a 100644
--- a/click/core.py
+++ b/click/core.py
@@ -1,4 +1,3 @@
-import errno
 import os
 import sys
 from contextlib import contextmanager
@@ -706,11 +705,6 @@ class BaseCommand(object):
                     raise
                 e.show()
                 sys.exit(e.exit_code)
-            except IOError as e:
-                if e.errno == errno.EPIPE:
-                    sys.exit(1)
-                else:
-                    raise
         except Abort:
             if not standalone_mode:
                 raise


Test patch:
diff --git a/tests/test_imports.py b/tests/test_imports.py
index bc54533..6a8a122 100644
--- a/tests/test_imports.py
+++ b/tests/test_imports.py
@@ -32,7 +32,7 @@ click.echo(json.dumps(rv))
 ALLOWED_IMPORTS = set([
     'weakref', 'os', 'struct', 'collections', 'sys', 'contextlib',
     'functools', 'stat', 're', 'codecs', 'inspect', 'itertools', 'io',
-    'threading', 'colorama', 'errno'
+    'threading', 'colorama'
 ])
 
 if WIN:
Repository: pallets/click
Pull request #842 (2017-08-17 18:01:12)

add bool conversions for t and f
Just thought this would be nice. Love Click!


Patch:
diff --git a/CHANGES b/CHANGES
index c3928da..4d78256 100644
--- a/CHANGES
+++ b/CHANGES
@@ -25,6 +25,7 @@ Version 7.0
   a Unix shell command. See #664.
 - Fix bug that caused bashcompletion to give inproper completions on 
   chained commands. See #774.
+- 't' and 'f' are now converted to True and False. 
 
 Version 6.8
 -----------
diff --git a/click/types.py b/click/types.py
index 5f5ebd6..fab63e4 100644
--- a/click/types.py
+++ b/click/types.py
@@ -274,9 +274,9 @@ class BoolParamType(ParamType):
         if isinstance(value, bool):
             return bool(value)
         value = value.lower()
-        if value in ('true', '1', 'yes', 'y'):
+        if value in ('true', 't,' '1', 'yes', 'y'):
             return True
-        elif value in ('false', '0', 'no', 'n'):
+        elif value in ('false', 'f', '0', 'no', 'n'):
             return False
         self.fail('%s is not a valid boolean' % value, param, ctx)
 
diff --git a/docs/parameters.rst b/docs/parameters.rst
index e545343..9e5587e 100644
--- a/docs/parameters.rst
+++ b/docs/parameters.rst
@@ -47,8 +47,8 @@ different behavior and some are supported out of the box:
 
 ``bool`` / :data:`click.BOOL`:
     A parameter that accepts boolean values.  This is automatically used
-    for boolean flags.  If used with string values ``1``, ``yes``, ``y``
-    and ``true`` convert to `True` and ``0``, ``no``, ``n`` and ``false``
+    for boolean flags.  If used with string values ``1``, ``yes``, ``y``, ``t``
+    and ``true`` convert to `True` and ``0``, ``no``, ``n``, ``f`` and ``false``
     convert to `False`.
 
 :data:`click.UUID`:


Test patch:
diff --git a/tests/test_basic.py b/tests/test_basic.py
index ec4df7d..573bcbf 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -180,6 +180,28 @@ def test_boolean_option(runner):
         assert result.output == '%s\n' % (default)
 
 
+def test_boolean_conversion(runner):
+    for default in True, False:
+        @click.command()
+        @click.option('--flag', default=default, type=bool)
+        def cli(flag):
+            click.echo(flag)
+
+        for value in 'true', 't,' '1', 'yes', 'y':
+            result = runner.invoke(cli, ['--flag', value])
+            assert not result.exception
+            assert result.output == 'True\n'
+
+        for value in 'false', 'f', '0', 'no', 'n':
+            result = runner.invoke(cli, ['--flag', value])
+            assert not result.exception
+            assert result.output == 'False\n'
+
+        result = runner.invoke(cli, [])
+        assert not result.exception
+        assert result.output == '%s\n' % default
+
+
 def test_file_option(runner):
     @click.command()
     @click.option('--file', type=click.File('w'))
Repository: pallets/click
Pull request #973 (2018-04-18 01:03:43)

Fix a typo
Fix a typo in parsing boolean values


Patch:
diff --git a/click/types.py b/click/types.py
index 8799682..f594005 100644
--- a/click/types.py
+++ b/click/types.py
@@ -277,7 +277,7 @@ class BoolParamType(ParamType):
         if isinstance(value, bool):
             return bool(value)
         value = value.lower()
-        if value in ('true', 't,' '1', 'yes', 'y'):
+        if value in ('true', 't', '1', 'yes', 'y'):
             return True
         elif value in ('false', 'f', '0', 'no', 'n'):
             return False


Test patch:
diff --git a/tests/test_basic.py b/tests/test_basic.py
index 94e0aae..8ba251f 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -187,7 +187,7 @@ def test_boolean_conversion(runner):
         def cli(flag):
             click.echo(flag)
 
-        for value in 'true', 't,' '1', 'yes', 'y':
+        for value in 'true', 't', '1', 'yes', 'y':
             result = runner.invoke(cli, ['--flag', value])
             assert not result.exception
             assert result.output == 'True\n'
Repository: pallets/click
Pull request #994 (2018-05-14 19:18:13)

Fix issue #926 - copy option attrs so that custom classes can be re-used.
Fix issue #926 - copy option attrs so that custom classes can be re-used.


Patch:
diff --git a/click/decorators.py b/click/decorators.py
index 8e5a462..bfc7a05 100644
--- a/click/decorators.py
+++ b/click/decorators.py
@@ -164,10 +164,13 @@ def option(*param_decls, **attrs):
                 :class:`Option`.
     """
     def decorator(f):
-        if 'help' in attrs:
-            attrs['help'] = inspect.cleandoc(attrs['help'])
-        OptionClass = attrs.pop('cls', Option)
-        _param_memo(f, OptionClass(param_decls, **attrs))
+        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
+        option_attrs = attrs.copy()
+
+        if 'help' in option_attrs:
+            option_attrs['help'] = inspect.cleandoc(option_attrs['help'])
+        OptionClass = option_attrs.pop('cls', Option)
+        _param_memo(f, OptionClass(param_decls, **option_attrs))
         return f
     return decorator
 


Test patch:
diff --git a/tests/test_options.py b/tests/test_options.py
index fcd755a..2cf62c8 100644
--- a/tests/test_options.py
+++ b/tests/test_options.py
@@ -311,6 +311,35 @@ def test_option_custom_class(runner):
     assert 'you wont see me' not in result.output
 
 
+def test_option_custom_class_reusable(runner):
+    """Ensure we can reuse a custom class option. See Issue #926"""
+
+    class CustomOption(click.Option):
+        def get_help_record(self, ctx):
+            '''a dumb override of a help text for testing'''
+            return ('--help', 'I am a help text')
+
+    # Assign to a variable to re-use the decorator.
+    testoption = click.option('--testoption', cls=CustomOption, help='you wont see me')
+
+    @click.command()
+    @testoption
+    def cmd1(testoption):
+        click.echo(testoption)
+
+    @click.command()
+    @testoption
+    def cmd2(testoption):
+        click.echo(testoption)
+
+    # Both of the commands should have the --help option now.
+    for cmd in (cmd1, cmd2):
+
+        result = runner.invoke(cmd, ['--help'])
+        assert 'I am a help text' in result.output
+        assert 'you wont see me' not in result.output
+
+
 def test_aliases_for_flags(runner):
     @click.command()
     @click.option('--warnings/--no-warnings', ' /-W', default=True)
Repository: pallets/click
Pull request #1002 (2018-05-15 13:53:16)

allow specify short width to address cmd formatting
add a flag to address the too short short_help width as requested in #936 




Patch:
diff --git a/click/core.py b/click/core.py
index 23a34c0..84a3941 100644
--- a/click/core.py
+++ b/click/core.py
@@ -769,7 +769,12 @@ class Command(BaseCommand):
         self.epilog = epilog
         self.options_metavar = options_metavar
         if short_help is None and help:
-            short_help = make_default_short_help(help)
+            if (context_settings is not None and
+                'short_help_width' in context_settings):
+                    short_width = context_settings.get('short_help_width')
+                    short_help = make_default_short_help(help, short_width)
+            else:
+                short_help = make_default_short_help(help)
         self.short_help = short_help
         self.add_help_option = add_help_option
         self.hidden = hidden


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
index e8a9535..af58e7a 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -59,12 +59,18 @@ def test_auto_shorthelp(runner):
         """This is a long text that is too long to show as short help
         and will be truncated instead."""
 
+    @cli.command(context_settings={'short_help_width': 20})
+    def width():
+        """This is a long text that is too long to show as short help
+        and will be truncated instead."""
+
     result = runner.invoke(cli, ['--help'])
     assert re.search(
         r'Commands:\n\s+'
         r'long\s+This is a long text that is too long to show\.\.\.\n\s+'
         r'short\s+This is a short text\.\n\s+'
-        r'special-chars\s+Login and store the token in ~/.netrc\.\s*',
+        r'special-chars\s+Login and store the token in ~/.netrc\.\s+'
+        r'width\s+This is a long text\.\.\.\n\s*',
         result.output) is not None
Repository: pallets/click
Pull request #1348 (2019-07-03 20:26:43)

Correct ZSH completion definitions
Supplying fix from https://github.com/cekit/cekit/pull/562.
This makes it auto-loadable (and adds some error handling)  - see http://zsh.sourceforge.net/Doc/Release/Completion-System.html

jcrotts: Could you add a changelog entry under 8.X, thanks for the PR.
rnc: Done! :-) 

( Not sure why the AppVeyor CI is failing - it looks like CI setup issues? )

Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index f126984..84da8cf 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -6,6 +6,7 @@ Version 8.0
 
 Unreleased
 
+-   Fix autoloading for ZSH completion and add error handling. (`#1348`_ )
 -   Adds a repr to Command, showing the command name for friendlier debugging. (`#1267`_, `#1295`_)
 -   Add support for distinguishing the source of a command line parameter. (`#1264`_, `#1329`_)
 -   Add an optional parameter to ``ProgressBar.update`` to set the
@@ -16,6 +17,7 @@ Unreleased
 .. _#1264: https://github.com/pallets/click/issues/1264
 .. _#1329: https://github.com/pallets/click/pull/1329
 .. _#1226: https://github.com/pallets/click/issues/1226
+.. _#1348: https://github.com/pallets/click/pull/1348
 .. _#1332: https://github.com/pallets/click/pull/1332
 
 
diff --git a/click/_bashcomplete.py b/click/_bashcomplete.py
index 0015b17..aa6a3bf 100644
--- a/click/_bashcomplete.py
+++ b/click/_bashcomplete.py
@@ -39,10 +39,14 @@ COMPLETION_SCRIPT_BASH = '''
 '''
 
 COMPLETION_SCRIPT_ZSH = '''
+#compdef %(script_names)s
+
 %(complete_func)s() {
     local -a completions
     local -a completions_with_descriptions
     local -a response
+    (( ! $+commands[%(script_names)s] )) && return 1
+
     response=("${(@f)$( env COMP_WORDS=\"${words[*]}\" \\
                         COMP_CWORD=$((CURRENT-1)) \\
                         %(autocomplete_var)s=\"complete_zsh\" \\


Test patch:
diff --git a/tests/test_compat.py b/tests/test_compat.py
index abc733b..674cded 100644
--- a/tests/test_compat.py
+++ b/tests/test_compat.py
@@ -25,6 +25,14 @@ def test_bash_func_name():
     assert '_COMPLETE_VAR=complete $1' in script
 
 
+def test_zsh_func_name():
+    from click._bashcomplete import get_completion_script
+    script = get_completion_script('foo-bar', '_COMPLETE_VAR', 'zsh').strip()
+    assert script.startswith('#compdef foo-bar')
+    assert 'compdef _foo_bar_completion foo-bar;' in script
+    assert '(( ! $+commands[foo-bar] )) && return 1' in script
+
+
 @pytest.mark.xfail(WIN, reason="Jupyter not tested/supported on Windows")
 def test_is_jupyter_kernel_output():
     class JupyterKernelFakeStream(object):
Repository: pallets/click
Pull request #1355 (2019-07-13 20:14:05)

Suggest renaming option from `name` to `--name`
Usually when I get this error message, it's because I wrote `@click.option('foo')` when I meant `@click.option('--foo')`. So this PR updates the error message to suggest the user fix that.


Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index ea5f8b4..5a7bde2 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -73,6 +73,8 @@ Unreleased
 -   Required arguments with the ``Choice`` type show the choices in
     curly braces to indicate that one is required (``{a|b|c}``).
     :issue:`1272`
+-   If only a name is passed to ``option()``, Click suggests renaming it
+    to ``--name``. :pr:`1355`
 
 
 Version 7.1.2
diff --git a/src/click/core.py b/src/click/core.py
index 6d6f299..e62059e 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1977,8 +1977,8 @@ class Option(Parameter):
         if not opts and not secondary_opts:
             raise TypeError(
                 f"No options defined but a name was passed ({name})."
-                " Did you mean to declare an argument instead of an"
-                " option?"
+                " Did you mean to declare an argument instead? Did"
+                f" you mean to pass '--{name}'?"
             )
 
         return name, opts, secondary_opts


Test patch:
diff --git a/tests/test_options.py b/tests/test_options.py
index 515af72..9f88e34 100644
--- a/tests/test_options.py
+++ b/tests/test_options.py
@@ -23,12 +23,13 @@ def test_prefixes(runner):
 
 
 def test_invalid_option(runner):
-    with pytest.raises(TypeError, match="name was passed"):
+    with pytest.raises(TypeError, match="name was passed") as exc_info:
+        click.Option(["foo"])
 
-        @click.command()
-        @click.option("foo")
-        def cli(foo):
-            pass
+    message = str(exc_info.value)
+    assert "name was passed (foo)" in message
+    assert "declare an argument" in message
+    assert "'--foo'" in message
 
 
 def test_invalid_nargs(runner):
Repository: pallets/click
Pull request #1406 (2019-10-09 05:14:27)

Make option format replace newlines with spaces.
#834 
Remade to point 7.x


Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index c357a80..dcf97d0 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -38,6 +38,8 @@ Unreleased
     ``CliRunner.invoke``. :issue:`1435`
 -   Fix ``TypeError`` raised when using bool flags and specifying
     ``type=bool``. :issue:`1287`
+-   Newlines in option help text are replaced with spaces before
+    re-wrapping to avoid uneven line breaks. :issue:`834`
 
 
 Version 7.0
diff --git a/click/core.py b/click/core.py
index 01d77aa..d4a29ae 100644
--- a/click/core.py
+++ b/click/core.py
@@ -943,7 +943,8 @@ class Command(BaseCommand):
         for param in self.get_params(ctx):
             rv = param.get_help_record(ctx)
             if rv is not None:
-                opts.append(rv)
+                part_a, part_b = rv
+                opts.append((part_a, part_b.replace('\n', ' ')))
 
         if opts:
             with formatter.section('Options'):


Test patch:
diff --git a/tests/test_options.py b/tests/test_options.py
index 896b286..e0f7878 100644
--- a/tests/test_options.py
+++ b/tests/test_options.py
@@ -398,9 +398,7 @@ def test_multiline_help(runner):
     result = runner.invoke(cmd, ['--help'])
     assert result.exit_code == 0
     out = result.output.splitlines()
-    assert '  --foo TEXT  hello' in out
-    assert '              i am' in out
-    assert '              multiline' in out
+    assert '  --foo TEXT  hello  i am  multiline' in out
 
 def test_argument_custom_class(runner):
     class CustomArgument(click.Argument):
Repository: pallets/click
Pull request #1480 (2020-02-24 15:23:34)

 Backport ZSH autoloading to 7.1
Cherry pick of #1348


Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index 0d4f409..8beb27d 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -57,7 +57,7 @@ Unreleased
     ``click.edit()``. :pr:`1469`
 -   Arguments to system calls such as the executable path passed to
     ``click.edit`` can contains spaces. :pr:`1470`
-
+-   Add ZSH completion autoloading and error handling. :issue:`1348`
 
 Version 7.0
 -----------
diff --git a/click/_bashcomplete.py b/click/_bashcomplete.py
index a5f1084..e97c539 100644
--- a/click/_bashcomplete.py
+++ b/click/_bashcomplete.py
@@ -39,10 +39,14 @@ COMPLETION_SCRIPT_BASH = '''
 '''
 
 COMPLETION_SCRIPT_ZSH = '''
+#compdef %(script_names)s
+
 %(complete_func)s() {
     local -a completions
     local -a completions_with_descriptions
     local -a response
+    (( ! $+commands[%(script_names)s] )) && return 1
+
     response=("${(@f)$( env COMP_WORDS=\"${words[*]}\" \\
                         COMP_CWORD=$((CURRENT-1)) \\
                         %(autocomplete_var)s=\"complete_zsh\" \\


Test patch:
diff --git a/tests/test_compat.py b/tests/test_compat.py
index abc733b..674cded 100644
--- a/tests/test_compat.py
+++ b/tests/test_compat.py
@@ -25,6 +25,14 @@ def test_bash_func_name():
     assert '_COMPLETE_VAR=complete $1' in script
 
 
+def test_zsh_func_name():
+    from click._bashcomplete import get_completion_script
+    script = get_completion_script('foo-bar', '_COMPLETE_VAR', 'zsh').strip()
+    assert script.startswith('#compdef foo-bar')
+    assert 'compdef _foo_bar_completion foo-bar;' in script
+    assert '(( ! $+commands[foo-bar] )) && return 1' in script
+
+
 @pytest.mark.xfail(WIN, reason="Jupyter not tested/supported on Windows")
 def test_is_jupyter_kernel_output():
     class JupyterKernelFakeStream(object):