tholo / pytest-flake8

pytest plugin to run flake8
Other
117 stars 47 forks source link

Can't terminate with Ctrl+C #41

Open andras-tim opened 6 years ago

andras-tim commented 6 years ago

I regurarly use pytest-flake8, but now I can't terminate the flake8 check with Ctrl+C, because the main thread is exited, but the tests still running.

foo@foo:~/test$ tox
py27 installed: attrs==17.3.0,backports-abc==0.5,certifi==2017.11.5,chardet==3.0.4,configparser==3.5.0,enum34==1.1.6,flake8==3.5.0,funcsigs==1.0.2,idna==2.6,lxml==4.1.1,mccabe==0.6.1,mock==2.0.0,pbr==3.1.1,pluggy
==0.6.0,py==1.5.2,pycodestyle==2.3.1,pyflakes==1.6.0,pytest==3.3.0,pytest-flake8==0.9.1,PyYAML==3.12,requests==2.18.4,selenium==3.8.0,singledispatch==3.4.0.3,six==1.11.0,tornado==4.5.2,urllib3==1.22              py27 runtests: PYTHONHASHSEED='782112150'
py27 runtests: commands[0] | py.test
FFFFFF^CERROR: KEYBOARDINTERRUPT
FFF^CERROR: keyboardinterrupt
foo@foo:~/test$ FFFFF
foo@foo:~/test$ F
foo@foo:~/test$
foo@foo:~/test$
foo@foo:~/test$ FF
foo@foo:~/test$ FFFFFFFF

I think, this is off-topic, but there are a lot of Captured log too:

manager.py                 210 DEBUG    Registered option "Option(-v, --verbose, action=count, default=0, dest=verbose, type=None, callback=None, help=Print more information about what is happening in flake8. Thi
s option is repeatable and will increase verbosity each time it is repeated., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py                 210 DEBUG    Registered option "Option(-q, --quiet, action=count, default=0, dest=quiet, type=None, callback=None, help=Report only file names, or nothing. This option is repeatable., c
allback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py                 210 DEBUG    Registered option "Option(None, --count, action=store_true, default=None, dest=count, type=None, callback=None, help=Print total number of errors and warnings to standard e
rror and set the exit code to 1 if total is not empty., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py                 210 DEBUG    Registered option "Option(None, --diff, action=store_true, default=None, dest=diff, type=None, callback=None, help=Report changes only within line number ranges in the unif
ied diff provided on standard in by the user., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py                 210 DEBUG    Registered option "Option(None, --exclude, action=None, default=.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg, dest=exclude, type=None, callback=None, help=Comma-sepa
rated list of files or directories to exclude. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=patterns)".
manager.py                 210 DEBUG    Registered option "Option(None, --filename, action=None, default=*.py, dest=filename, type=None, callback=None, help=Only check for filenames matching the patterns in this 
comma-separated list. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=patterns)".
manager.py                 210 DEBUG    Registered option "Option(None, --stdin-display-name, action=None, default=stdin, dest=stdin_display_name, type=None, callback=None, help=The name used when reporting error
s from code passed via stdin. This is useful for editors piping the file contents to flake8. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py                 210 DEBUG    Registered option "Option(None, --format, action=None, default=default, dest=format, type=None, callback=None, help=Format errors according to the chosen formatter., callba
ck=None, callback_args=None, callback_kwargs=None, metavar=format)".
manager.py                 210 DEBUG    Registered option "Option(None, --hang-closing, action=store_true, default=None, dest=hang_closing, type=None, callback=None, help=Hang closing bracket instead of matching 
indentation of opening bracket's line., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py                 210 DEBUG    Registered option "Option(None, --ignore, action=None, default=E121,E123,E126,E226,E24,E704,W503,W504, dest=ignore, type=None, callback=None, help=Comma-separated list of e
rrors and warnings to ignore (or skip). For example, ``--ignore=E4,E51,W234``. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=errors)".
manager.py                 210 DEBUG    Registered option "Option(None, --max-line-length, action=None, default=79, dest=max_line_length, type=int, callback=None, help=Maximum allowed line length for the entirety
 of this run. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=n)".
manager.py                 210 DEBUG    Registered option "Option(None, --select, action=None, default=E,F,W,C90, dest=select, type=None, callback=None, help=Comma-separated list of errors and warnings to enable.
 For example, ``--select=E4,E51,W234``. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=errors)".
manager.py                 210 DEBUG    Registered option "Option(None, --disable-noqa, action=store_true, default=False, dest=disable_noqa, type=None, callback=None, help=Disable the effect of "# noqa". This wil
l report errors on lines with "# noqa" at the end., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py                 210 DEBUG    Registered option "Option(None, --show-source, action=store_true, default=None, dest=show_source, type=None, callback=None, help=Show the source generate each error or warn
ing., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py                 210 DEBUG    Registered option "Option(None, --statistics, action=store_true, default=None, dest=statistics, type=None, callback=None, help=Count errors and warnings., callback=None, ca
llback_args=None, callback_kwargs=None, metavar=None)".
...
tholo commented 6 years ago

The plugin does not do anything to make this be the case... Are you sure this is due to the pytest-flake8 plugin? It does not happen with other plugins (or the base of pytest)? Does it happen if you run pytest directly (and not with tox)?

andras-tim commented 6 years ago

@tholo, I'm going to check something for I can provide more details. I have an idea about it can be a pytest bug instead of pytest-flake8 (e.g. a masked or badly propagated signal)

In other hands, why I get this lof of debug messages into the captured log when I enable pytest-flake8 plugin?

tholo commented 6 years ago

Because you have one or more flake8 “failures”, which causes pytest to output any and all captured log output during the failed “test”; this is new behavior in pytest...

Thorsten

On Dec 7, 2017, at 14:26, Andras Tim notifications@github.com wrote:

@tholo, I'm going to check something for I can provide more details. I have an idea about it can be a pytest bug instead of pytest-flake8 (e.g. a masked or badly propagated signal)

In other hands, why I get this lof of debug messages into the captured log when I enable pytest-flake8 plugin?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.