nbQA-dev / nbQA

Run ruff, isort, pyupgrade, mypy, pylint, flake8, and more on Jupyter Notebooks
https://nbqa.readthedocs.io/en/latest/index.html
MIT License
1.04k stars 41 forks source link

Fixup ci #780

Closed MarcoGorelli closed 1 year ago

MarcoGorelli commented 1 year ago

@s-weigand any idea what might be going on here? It passes for me locally on Windows

================================== FAILURES ===================================
________________________________ test_cmdline _________________________________

cls = <class '_pytest.runner.CallInfo'>
func = <function call_runtest_hook.<locals>.<lambda> at 0x00000269E2EE2AF0>
when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)

    @classmethod
    def from_call(
        cls,
        func: "Callable[[], TResult]",
        when: "Literal['collect', 'setup', 'call', 'teardown']",
        reraise: Optional[
            Union[Type[BaseException], Tuple[Type[BaseException], ...]]
        ] = None,
    ) -> "CallInfo[TResult]":
        """Call func, wrapping the result in a CallInfo.

        :param func:
            The function to call. Called without arguments.
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: Optional[TResult] = func()

.tox\py\lib\site-packages\_pytest\runner.py:339: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\py\lib\site-packages\_pytest\runner.py:260: in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
.tox\py\lib\site-packages\pluggy\_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
.tox\py\lib\site-packages\pluggy\_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
.tox\py\lib\site-packages\_pytest\threadexception.py:83: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def thread_exception_runtest_hook() -> Generator[None, None, None]:
        with catch_threading_exception() as cm:
            yield
            if cm.args:
                thread_name = "<unknown>" if cm.args.thread is None else cm.args.thread.name
                msg = f"Exception in thread {thread_name}\n\n"
                msg += "".join(
                    traceback.format_exception(
                        cm.args.exc_type,
                        cm.args.exc_value,
                        cm.args.exc_traceback,
                    )
                )
>               warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
E               pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-14
E               
E               Traceback (most recent call last):
E                 File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\threading.py", line 932, in _bootstrap_inner
E                   self.run()
E                 File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\threading.py", line 870, in run
E                   self._target(*self._args, **self._kwargs)
E                 File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\subprocess.py", line 1370, in _readerthread
E                   buffer.append(fh.read())
E                 File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\encodings\cp1252.py", line 23, in decode
E                   return codecs.charmap_decode(input,self.errors,decoding_table)[0]
E               UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 71: character maps to <undefined>

.tox\py\lib\site-packages\_pytest\threadexception.py:73: PytestUnhandledThreadExceptionWarning
MarcoGorelli commented 1 year ago

finally did it #782

s-weigand commented 1 year ago

Sorry for the late replay, windows + shell encoding is just horrible -.- Nearly 2023 and we still have issues with