python / python/cpython

unittest fails with "Start directory is not importable" when trying to run sourceless tests

Open
#71,046 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib tests type-bug
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

BPO 26859
Nosy @rbtcollins, @Fak3, @vadmium
Files
  • unittest.patch
  • unittest_2.patch: with a test case
  • unittest_3.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2016-04-26.13:42:17.449>
    labels = ['tests', 'type-bug', 'library']
    title = 'unittest fails with "Start directory is not importable" when trying to run sourceless tests'
    updated_at = <Date 2019-12-10.08:16:01.494>
    user = 'https://github.com/xdegaye'
    

    bugs.python.org fields:

    activity = <Date 2019-12-10.08:16:01.494>
    actor = 'xdegaye'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'Tests']
    creation = <Date 2016-04-26.13:42:17.449>
    creator = 'xdegaye'
    dependencies = []
    files = ['42611', '42646', '43507']
    hgrepos = []
    issue_num = 26859
    keywords = ['patch']
    message_count = 7.0
    messages = ['264283', '264338', '264361', '264431', '264472', '268918', '269055']
    nosy_count = 4.0
    nosy_names = ['rbcollins', 'Roman.Evstifeev', 'martin.panter', 'Pam.McANulty']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue26859'
    versions = ['Python 3.6']
    

    Contributor guide

    Open the contributing guide

    First steps

    1. Read the whole issue, then the project's contributing guide.
    2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
    3. Fork the repository and make your change on a branch.
    4. Open a pull request that references the issue number.

    Research direction

    Start by reviewing unittest.patch and unittest_2.patch, especially the included test case, then examine the unittest test-discovery behavior for sourceless tests. Compare the later unittest_3.patch with the reported failure. Done means the sourceless-test scenario no longer raises "Start directory is not importable" and the regression test passes.

    Written by the indexing model from the issue text.

    Assessment

    Tech stack
    python
    Domain
    testing-qa
    Issue type
    Bug
    Difficulty
    4/5
    Estimated time
    3-5 days
    Activity status
    Stale
    Clarity
    Mostly clear
    Newbie friendliness
    30/100

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.