Skip to content

WIP Update nodes.py for supporting unicode nodeid - #4567

Closed
liuchunming033 wants to merge 1 commit into
pytest-dev:masterfrom
liuchunming033:master
Closed

liuchunming033 wants to merge 1 commit into
pytest-dev:masterfrom
liuchunming033:master

Conversation

@liuchunming033

Copy link
Copy Markdown

support unicode

Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs (you can delete this text from the final description, this is
just a guideline):

  • Create a new changelog file in the changelog folder, with a name like <ISSUE NUMBER>.<TYPE>.rst. See changelog/README.rst for details.
  • Target the master branch for bug fixes, documentation updates and trivial changes.
  • Target the features branch for new features and removals/deprecations.
  • Include documentation when adding new features.
  • Include new tests or update existing tests when applicable.

Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:

  • Add yourself to AUTHORS in alphabetical order;

support unicode
@RonnyPfannschmidt

Copy link
Copy Markdown
Member

hi @liuchunming033 ,

i presume you are trying to make pytest ready for use with your native language, which is a great goal 👍

as the failed test shows, there are probably a few more unfortunate assumptions in the codebase about unicode names and unicode test names, in particular with the way that bytes are encoded in test names as well

so i fear there is going to be quite a chunk of unexpected work and extra test writing needed to make the handling of this solid

while we do have some good results with unicode in parameters,
we don't yet have any deeper experience with unicode in the function and test names in general,

so i'm thrilled to see someone affected with those details taking a closer look

as at least i am pretty ascii centric and cant even hope to do this due diligence as of now
(after all its incredibly easy to miss a detail of unicode if all you personally work with is ascii)

@nicoddemus nicoddemus changed the title Update nodes.py for supporting unicode nodeid WIP Update nodes.py for supporting unicode nodeid Dec 20, 2018
@nicoddemus

Copy link
Copy Markdown
Member

I would hold this until we drop Python 2 support, because while it is possible, there are too many gotchas in Python 2 to support this sanely.

@liuchunming033

liuchunming033 commented Mar 14, 2019 •

Copy link
Copy Markdown
Author

Goals achieved which I use my native language describe my test case name.
I implement this hook,:

@pytest.fixture(scope="session")
def pytest_collection_modifyitems(items):
    for item in items:
        item.name = item.name.encode("utf-8").decode("unicode_escape")
    return pytest_collection_modifyitems

@nicoddemus

Copy link
Copy Markdown
Member

Hi @liuchunming033,

It has been a long time since it has last seen activity, plus we have made sweeping changes on master to drop Python 2.7 and 3.4 support, so this PR has some conflicts which require attention. You might give this another go now that master only supports Python 3.5+.

In order to clear up our queue and let us focus on the active PRs, I'm closing this PR for now.

Please don't consider this a rejection of your PR, we just want to get this out of sight until you have the time to tackle this again. If you get around to work on this in the future, please don't hesitate in re-opening this!

Thanks for your work, the team definitely appreciates it!

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