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

Improve idmaker name selection in case of duplicate ids in parametrize #1474

Merged

Conversation

palaviv
Copy link
Contributor

@palaviv palaviv commented Mar 22, 2016

As @RonnyPfannschmidt mentioned in pull request #1468 the name selection in case of duplicate ids had some problems.
Let's take for example:

import pytest
@pytest.mark.parametrize("a", [1,2,3,4,5,6], ids=["a", "a", "b", "c", "b", "l"])
def test_a(a,b):
    pass

Before this change the tests names would be:

  • test_a[0a]
  • test_a[1a]
  • test_a[2b]
  • test_a[3c]
  • test_a[4b]
  • test_a[5l]

After this change:

  • test_a[a0]
  • test_a[a1]
  • test_a[b0]
  • test_a[c]
  • test_a[b1]
  • test_a[l]

@@ -26,7 +26,8 @@
* parametrize ids can accept None as specific test id. The
automatically generated id for that argument will be used.

*
* improved idmaker name selection in case of duplicate ids in
Copy link
Member

Choose a reason for hiding this comment

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

Please include a "thanks palaviv" and mention #1474. You might want to do the same for the item just above this one. 😉

@palaviv
Copy link
Contributor Author

palaviv commented Mar 23, 2016

It seems that the travis-ci failed because of some error unrelated to the tests:

The command "curl -s -o python-3.5.tar.bz2 https://s3.amazonaws.com/travis-python archives/binaries/$(lsb_release -is | tr "A-Z" "a-z")/$(lsb_release -rs)/$(uname -m)/python-3.5.tar.bz2" failed and exited with 18 during .

Is there a way to rerun the build?

@The-Compiler
Copy link
Member

I just restarted the failing build.

@nicoddemus nicoddemus merged commit fed89ef into pytest-dev:features Mar 23, 2016
@nicoddemus
Copy link
Member

Thanks again @palaviv! 😄

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.

3 participants