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

MagicMock should support __fspath__ #79203

Closed
MaximeBelanger mannequin opened this issue Oct 19, 2018 · 4 comments
Closed

MagicMock should support __fspath__ #79203

MaximeBelanger mannequin opened this issue Oct 19, 2018 · 4 comments
Labels
3.8 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@MaximeBelanger
Copy link
Mannequin

MaximeBelanger mannequin commented Oct 19, 2018

BPO 35022
Nosy @vstinner, @voidspace, @tirkarthi
PRs
  • bpo-35022: Add __fspath__ support to unittest.mock.MagicMock #9960
  • 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 = <Date 2019-06-06.08:39:46.884>
    created_at = <Date 2018-10-19.00:29:50.849>
    labels = ['3.8', 'type-feature', 'library']
    title = 'MagicMock should support `__fspath__`'
    updated_at = <Date 2019-06-06.08:39:46.883>
    user = 'https://bugs.python.org/MaximeBelanger'

    bugs.python.org fields:

    activity = <Date 2019-06-06.08:39:46.883>
    actor = 'xtreak'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-06.08:39:46.884>
    closer = 'xtreak'
    components = ['Library (Lib)']
    creation = <Date 2018-10-19.00:29:50.849>
    creator = 'Maxime Belanger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35022
    keywords = ['patch']
    message_count = 4.0
    messages = ['328014', '328498', '328499', '344793']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'michael.foord', 'Maxime Belanger', 'xtreak']
    pr_nums = ['9960']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35022'
    versions = ['Python 3.8']

    @MaximeBelanger
    Copy link
    Mannequin Author

    MaximeBelanger mannequin commented Oct 19, 2018

    We have plenty of tests calling into os.path.* functions, and as Python 3.6+ gets more stringent about checking for os.PathLike compliance, it would greatly simplify our lives for MagicMock to support __fspath__.

    @MaximeBelanger MaximeBelanger mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Oct 19, 2018
    @vstinner
    Copy link
    Member

    New changeset 6c83d9f by Victor Stinner (Max Bélanger) in branch 'master':
    bpo-35022: unittest.mock.MagicMock now also supports __fspath__ (GH-9960)
    6c83d9f

    @vstinner
    Copy link
    Member

    Thanks Maxime Belanger for your contribution! Thanks Mario Corchero for the review.

    Oh, you added Python 3.7 to this issue, but sadly we don't add new features to minor Python versions (like Python 3.7.2) :-( Otherwise, it would mean that depending on the minor version, you may or may get the feature...

    You will have to workaround MagicMock limitation until Python 3.8 is released.

    @vstinner vstinner removed the 3.7 (EOL) end of life label Oct 25, 2018
    @tirkarthi
    Copy link
    Member

    Closing this as resolved since this is merged for 3.8. Thank you all.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants