Skip to content

Better Unicode handling in ID generation #656

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

Closed
pytestbot opened this issue Jan 13, 2015 · 2 comments
Closed

Better Unicode handling in ID generation #656

pytestbot opened this issue Jan 13, 2015 · 2 comments
Labels
topic: parametrize related to @pytest.mark.parametrize type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: thiefmaster, GitHub: thiefmaster


some::test[foo-bar] is much nicer than some::test[a0-b0]

Any non-ascii characters could be simply skipped or replaced with an underscore (or even transliterated).

I think it would also make perfect sense to replace whitespace with underscores.


@pytestbot pytestbot added the type: enhancement new feature or API change, should be merged into features branch label Jun 15, 2015
@pfctdayelise
Copy link
Contributor

@ThiefMaster

Example test:

@pytest.mark.parametrize('a', ['aa',
                               u'æ'])
def test_bar(a):
    pass

In python3 these will have nice names, in python 2 not.

Re replacing whitespace with underscores, not sure about that as you might have two distinct examples one with whitespace and one with underscores. Picking apart unicode and skipping random chars sounds like a recipe for trouble. On python2 we should either make them have a nice name (matching python3 behaviour) or tell people to specify ids if they want nicer names to be generated.

@nicoddemus
Copy link
Member

#1031 probably is a good enough solution here, so I'm closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: parametrize related to @pytest.mark.parametrize type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

3 participants