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

Easy way to spit out all the failing test names as plain text #640

Closed
pytestbot opened this issue Dec 10, 2014 · 6 comments
Closed

Easy way to spit out all the failing test names as plain text #640

pytestbot opened this issue Dec 10, 2014 · 6 comments
Labels
type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: ivanmalison, GitHub: ivanmalison


This seems like a such a basic and obvious feature, but I've scoured the documentation and I can't seem to find any mention of how to do this.


@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


Did you try -rf which will report failing test IDs which you can then copy/paste as commandline arguments?

@pytestbot
Copy link
Contributor Author

Original comment by BitBucket: ivanmalison, GitHub: ivanmalison:


No I didn't. This is pretty much exactly what I want. Why not have this show up when pytest -h is exectued?

@pytestbot
Copy link
Contributor Author

Original comment by Brianna Laugher (BitBucket: pfctdayelise, GitHub: pfctdayelise):


Ivan, it does, under reporting:


  -r chars              show extra test summary info as specified by chars
                        (f)ailed, (E)error, (s)skipped, (x)failed, (X)passed
                        (w)warnings.

Although, it now strikes me as a bit funny that there is no single page on the website that explains each command line option in more detail. The -r flag is mentioned in a couple of pages but the difference between using it and not is not really made clear. Perhaps that would be a useful documentation page to add?

@pytestbot
Copy link
Contributor Author

Original comment by BitBucket: ivanmalison, GitHub: ivanmalison:


I'm running pytest==2.6.4, and i do not get this entry when I run pytest -h. Here is what I get:

#!bash

Usage: pytest [OPTIONS] [testfile [testpattern]]

examples:

pytest path/to/mytests.py
pytest path/to/mytests.py TheseTests
pytest path/to/mytests.py TheseTests.test_thisone
pytest path/to/mytests.py -m '(not long and database) or regr'

pytest one (will run both test_thisone and test_thatone)
pytest path/to/mytests.py -s not (will skip test_notthisone)


Options:
  -h, --help            show this help message and exit
  -t TESTDIR            directory where the tests will be found
  -d                    enable design-by-contract
  -v, --verbose         Verbose output
  -i, --pdb             Enable test failure inspection
  -x, --exitfirst       Exit on first failure (only make sense when pytest run
                        one test file)
  -R, --restart         Restart tests from where it failed (implies exitfirst)
                        (only make sense if tests previously ran with
                        exitfirst only)
  --color               colorize tracebacks
  -s SKIPPED, --skip=SKIPPED
                        test names matching this name will be skipped to skip
                        several patterns, use commas
  -q, --quiet           Minimal output
  -P PROFILE, --profile=PROFILE
                        Profile execution and store data in the given file
  -m TAGS_PATTERN, --match=TAGS_PATTERN
                        only execute test whose tag match the current pattern




@pytestbot
Copy link
Contributor Author

Original comment by Brianna Laugher (BitBucket: pfctdayelise, GitHub: pfctdayelise):


Hopefully this is not silly. But what do you get if you run py.test -h ? Py.test is usually invoked from the command-line with the dot, although when you import it in your Python files it should be import pytest.

When I run pytest -h, Ubuntu tells me:

The program 'pytest' is currently not installed. You can install it by typing:
sudo apt-get install python-logilab-common

Running that command DOES make available a command-line pytest, from logilab, it seems like they are maintaining a very old version of pytest which does have that help text.

So maybe normally you run py.test at the command line, but you have this logilab thing installed and when running the help command you accidentally ran it as pytest -h without the dot?

@pytestbot
Copy link
Contributor Author

Original comment by Brianna Laugher (BitBucket: pfctdayelise, GitHub: pfctdayelise):


@ivanmalison if you find you still have this problem please reopen, I'm going to assume this is resolved otherwise.

@pytestbot pytestbot added the type: enhancement new feature or API change, should be merged into features branch label Jun 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

1 participant