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

Drop duplicated tests by default #1609 #1756

Merged
merged 1 commit into from
Jul 25, 2016

Conversation

ioggstream
Copy link
Contributor

When using pytest --skip-duplicates:

  • ignores duplicate tests on the basis of the purebasename;
  • take into account only the first one;

@coveralls
Copy link

coveralls commented Jul 23, 2016

Coverage Status

Coverage decreased (-0.01%) to 93.026% when pulling 83fabcc on ioggstream:1609-features into ae07985 on pytest-dev:features.

@nicoddemus
Copy link
Member

Hey @ioggstream,

I'm wondering, in which situations would be useful to drop different tests just because they have the same name?

At first I thought this was implementing #1609.

@nicoddemus
Copy link
Member

(At the moment I'm a strong 👎 on this, unless I misunderstood the implementation... it makes it very easy for someone to rename a test in some separate directory to the same name used elsewhere by accident and it will simply skip the second test).

@coveralls
Copy link

coveralls commented Jul 23, 2016

Coverage Status

Coverage decreased (-0.01%) to 93.026% when pulling a3c716b on ioggstream:1609-features into ae07985 on pytest-dev:features.

@ioggstream
Copy link
Contributor Author

@nicoddemus fixed to avoid duplicate paths, not names.

@nicoddemus
Copy link
Member

Oh OK, that makes more sense, thanks. 😅

I think dropping duplicated test paths on the command line should be the default behavior as discussed in #1609 though. Would you mind implementing it as such and adding a --keep-duplicates instead?

Also, I think we need a small doc update with the new option.

@ioggstream
Copy link
Contributor Author

I implemented it this way to not change the default behavior.

Should I turn it to keep-duplicate?

Peace.
R
Il 23/lug/2016 17:46, "Bruno Oliveira" notifications@github.com ha
scritto:

Oh OK, that makes more sense, thanks. 😅

I think dropping duplicated test paths on the command line should be the
default behavior as discussed in #1609
#1609 though. Would you mind
implementing it as such and adding a --keep-duplicates instead?

Also, I think we need a small doc update with the new option.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1756 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABFobIZuGnHbz5ChBabdOUwhGVYevb95ks5qYjdugaJpZM4JTX5M
.

@nicoddemus
Copy link
Member

Should I turn it to keep-duplicate?

Yes please. We were planning to do this backward incompatible change eventually, and 3.0 seems like an excellent opportunity to do so.

def test_real():
pass
"""))
fpath = fh.strpath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fpath is unused, which is currently failing the lint test.

@ioggstream ioggstream force-pushed the 1609-features branch 2 times, most recently from d169d77 to 306b87d Compare July 25, 2016 10:20
…from the command line. Use --keep-duplicates to retain duplicate paths.
@coveralls
Copy link

coveralls commented Jul 25, 2016

Coverage Status

Coverage decreased (-0.01%) to 93.047% when pulling ab6aef1 on ioggstream:1609-features into a24146d on pytest-dev:features.

@@ -973,7 +973,7 @@ def pytest_generate_tests(metafunc):
"""))
sub1.join("test_in_sub1.py").write("def test_1(): pass")
sub2.join("test_in_sub2.py").write("def test_2(): pass")
result = testdir.runpytest("-v", "-s", sub1, sub2, sub1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicoddemus @tomviner I had to change this test because the patch changed the default behavior.

@nicoddemus nicoddemus merged commit ab6aef1 into pytest-dev:features Jul 25, 2016
@nicoddemus
Copy link
Member

Thanks @ioggstream! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants