Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plurality mismatch in warnings #5989

Closed
4 tasks done
MarcoGorelli opened this issue Oct 18, 2019 · 3 comments
Closed
4 tasks done

Plurality mismatch in warnings #5989

MarcoGorelli opened this issue Oct 18, 2019 · 3 comments
Labels
plugin: warnings related to the warnings builtin plugin topic: reporting related to terminal output and user-facing messages and errors

Comments

@MarcoGorelli
Copy link
Contributor

MarcoGorelli commented Oct 18, 2019

  • a detailed description of the bug or suggestion
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible

Admittedly this is a very minor issue.

If I write a file pytest_example.py as

import warnings

warnings.warn("one warning")

and then run

pytest pytest_example.py

from the command line, the output reads

1 warnings in 0.02s

I believe this should read "1 warning in 0.02s".

Would a PR to address this be welcome?

$ pip list
Package            Version
------------------ -------
atomicwrites       1.3.0  
attrs              19.3.0 
importlib-metadata 0.23   
more-itertools     7.2.0  
packaging          19.2   
pip                19.0.3 
pluggy             0.13.0 
py                 1.8.0  
pyparsing          2.4.2  
pytest             5.2.1  
setuptools         40.8.0 
six                1.12.0 
wcwidth            0.1.7  
zipp               0.6.0  

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic
@The-Compiler
Copy link
Member

Similarly this:

import pytest

@pytest.fixture
def fix():
    raise Exception

def test_foo(fix):
    pass

def test_bar(fix):
    pass

displays "2 error in ...s".

Those messages are generated via build_summary_stats_line in terminal.py - but I'm not sure what the best way would be to handle this, as e.g. plugins can insert their own outcomes there as well.

@nicoddemus
Copy link
Member

I think fixing our core messages is OK, so IMHO a PR would be welcome @MarcoGorelli!

@Zac-HD Zac-HD added plugin: warnings related to the warnings builtin plugin topic: reporting related to terminal output and user-facing messages and errors labels Oct 20, 2019
@blueyed
Copy link
Contributor

blueyed commented Oct 28, 2019

Fixed in #5990 (features).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: warnings related to the warnings builtin plugin topic: reporting related to terminal output and user-facing messages and errors
Projects
None yet
Development

No branches or pull requests

5 participants