Skip to content

tests, test? #133

Open
Open

Description

@tomchen

pypa/sampleproject and Python Packaging User Guide's "Packaging Python Projects" page suggest the unit test folder be named tests. But by default, all files matching the pattern test/test*.py, not tests/test*.py, are included in the source distribution. Indeed, I renamed tests to test in sampleproject, then python setup.py sdist bdist_wheel will create a dist package that includes test/test*.py.

Or, did sampleproject intentionally change the name to avoid sdist's inclusion of the test files? That'd be a weird way to do so. It would be better to rename it back to test and explicitly put an exclude line in MANIFEST.in if you want the exclusion.

Activity

  1. dmtucker commented on Dec 20, 2020

    @dmtucker
    Contributor

    tests is far more common in my experience. I'm kinda surprised to hear test is included in sdists by default... not sure why that would be desirable.

  2. chrahunt commented on Dec 20, 2020

    @chrahunt
    Member

    The only reason I know of for naming the folder tests is to avoid conflicting with the test standard library module.

  3. tomchen commented on Dec 20, 2020

    @tomchen
    Author

    Yeah right. It should be a pypa/setuptools issue, I opened a PR there.

    Meanwhile, there is still something sampleproject could do: maybe add a include line to MANIFEST.in to ask setuptools for the inclusion of tests?

  4. tomchen commented on Dec 20, 2020

    @tomchen
    Author

    The PR there (pypa/setuptools#2494) got closed for some... technical reasons, it is complicated to add tests/test* until other problems are solved...

    So I guess here's what we can do now:

  5. di commented on Oct 30, 2021

    @di
    SponsorMember

    The directory in this project should probably just change to test so that it aligns with the default setuptools behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions