René's URL Explorer Experiment


Title: Overbroad xfail marks will eventually make CI fail · Issue #1728 · gitpython-developers/GitPython · GitHub

Open Graph Title: Overbroad xfail marks will eventually make CI fail · Issue #1728 · gitpython-developers/GitPython

X Title: Overbroad xfail marks will eventually make CI fail · Issue #1728 · gitpython-developers/GitPython

Description: Background #1679 included improvements to a number of tests that are known to fail on some platforms, by marking them xfail instead of skip so they are still run and their status is reported, but without a failing status causing the whol...

Open Graph Description: Background #1679 included improvements to a number of tests that are known to fail on some platforms, by marking them xfail instead of skip so they are still run and their status is reported, but w...

X Description: Background #1679 included improvements to a number of tests that are known to fail on some platforms, by marking them xfail instead of skip so they are still run and their status is reported, but w...

Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1728

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Overbroad xfail marks will eventually make CI fail","articleBody":"### Background\r\n\r\n#1679 included improvements to a number of tests that are known to fail on some platforms, by marking them `xfail` instead of `skip` so they are still run and their status is reported, but without a failing status causing the whole test run to fail. However, it applied [`xfail`](https://docs.pytest.org/en/7.1.x/how-to/skipping.html#xfail-mark-test-functions-as-expected-to-fail) to too many tests, due to limitations on granularity when applying [`pytest` marks](https://docs.pytest.org/en/latest/how-to/mark.html) to `unittest` test cases generated by `@ddt` parameterization.\r\n\r\nhttps://github.com/gitpython-developers/GitPython/blob/340da6d39397253da8d0807179b0ecb5952effca/test/test_util.py#L221-L228\r\n\r\nhttps://github.com/gitpython-developers/GitPython/blob/340da6d39397253da8d0807179b0ecb5952effca/test/test_util.py#L233-L245\r\n\r\n### Upcoming impact\r\n\r\nAlthough this was known and discussed in #1679, and FIXME comments about it were included in the code, the problem turns out to be somewhat more serious than I had anticipated: if not addressed, it will eventually lead to test failures in a future version of `pytest`. This is because the default behavior of an *unexpectedly passing* test--one that is marked `xfail` but passes--will most likely change in pytest 8. Because GitPython does not specify upper bounds on most of its development dependencies, and pytest is one of the development dependencies for which no upper bound is specified, pytest 8 will be automatically installed once it is (stably) released.\r\n\r\n Specifically, and in the absence of configuration or command-line options to `pytest` that override the behavior:\r\n\r\n- A test marked `xfail` that fails, and fails in the expected way, produces an XFAIL status, which is treated similarly to PASS. We always want this.\r\n- A test marked `xfail` that fails in a detectably unexpected way--where a different exception results than the one that was [expected](https://docs.pytest.org/en/7.1.x/how-to/skipping.html#raises-parameter)--produces a FAIL status. We always want this.\r\n- A test marked `xfail` that *passes* produces an XPASS status. How this status is treated is more complicated. The `xfail` mark supports [an optional `strict` parameter](https://docs.pytest.org/en/7.1.x/how-to/skipping.html#strict-parameter). Where present, it determines whether the XPASS fails the test run like a FAIL status would, or does not fail the test run (thus behaving like PASS or XFAIL). If absent, the `xfail_strict` configuration option provides the default. Currently, as of pytest 7, `xfail_strict` defaults to `False` when not specified.\r\n\r\nAs noted in https://github.com/pytest-dev/pytest/issues/11467, which was opened by a pytest maintainer and is listed for pytest's [8.0 milestone](https://github.com/pytest-dev/pytest/milestone/35), the default is planned to be changed from `False` to `True` starting in pytest 8.0. (See also https://github.com/pytest-dev/pytest/pull/11499.)\r\n\r\n### Possible fixes\r\n\r\nBreakage could be avoided (at least for a while, since `strict=False` [may eventually](https://github.com/pytest-dev/pytest/issues/11467#issuecomment-1733852526) be removed as a feature) by passing `strict=False` or setting `xfail_strict=false` for `pytest` in `pyproject.toml`. It is also possible to set an upper bound like `\u003c8` for `pytest` in `test-requirements.txt`.\r\n\r\nHowever, I recommend this instead be fixed by reorganizing the tests in `test_util.py` so that the tests of `cygpath` and `decygpath`--which are the ones that have the insufficiently precise `xfail` markings that mark some generated test cases `xfail` even though they are known to pass--can be pure `pytest` tests. Because they are currently `unittest` tests, they cannot be generated by `@pytest.mark.parametrize` (hence `@ddt` is used). But if they could be generated with the `parametrize` mark then they could have per-case markings, because `parametrize` supports an optional `marks` argument. They could then have the `xfail` mark applied to exactly the cases where failure is really expected.\r\n\r\nThat approach – which I mentioned in #1679 itself and in https://github.com/gitpython-developers/GitPython/pull/1700#discussion_r1353654395, and more recently alluded to in #1725 and https://github.com/gitpython-developers/GitPython/pull/1726#issuecomment-1791541248 – has the following advantages over other approaches that effectively just suppress the problem:\r\n\r\n- Any XPASS will be a sign that something has changed and should be looked into, thereby building on the improvements in [#1679](https://github.com/gitpython-developers/GitPython/pull/1679).\r\n- Although we have FIXME comments, the current situation is still misleading in the test results themselves, which indicate that some tests are unexpectedly passing.\r\n- When the default treatment of XPASS in `pytest` changes--but also even before that, once it is documented to change--the presence of expected XPASSes will be more misleading than it is already, even if GitPython is not using a version of `pytest` affected by the change. This is because that change will further solidify people's expectations about what XPASS indicates, including for people who are trying to become familiar with GitPython.\r\n- Reorganizing the tests in `test_util.py` can also help clarify the tests of `rmtree` behavior, and help make them easier to modify. This is useful because it will allow building on [#1700](https://github.com/gitpython-developers/GitPython/pull/1700) toward an eventual complete fix for [#790](https://github.com/gitpython-developers/GitPython/issues/790). (In addition, I want to make sure the [planned](https://github.com/gitpython-developers/GitPython/pull/1654#issuecomment-1717239735) native Windows CI jobs don't have the effect of calcifying cleanup logic in `rmtree` that otherwise could or should change, or at least that this does not happen in ways that impinge on non-Windows platforms. I think such a reorganization will help with that, too.)\r\n\r\nI have opened #1729, which fixes this issue by reorganizing tests in `test_util.py` in this way.","author":{"url":"https://github.com/EliahKagan","@type":"Person","name":"EliahKagan"},"datePublished":"2023-11-03T15:20:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/1728/GitPython/issues/1728"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fff84537-60fe-d68e-dfa8-b0d30de28502
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD6AC:2C7AF9:37B04A:4A6666:69683237
html-safe-noncebd203b3a07b87c4c94e9409116983a539e7294c62c52023c4a50b7df31bbc25b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkFDOjJDN0FGOTozN0IwNEE6NEE2NjY2OjY5NjgzMjM3IiwidmlzaXRvcl9pZCI6IjkxNTE3NjY1NzE0OTc1NjY3NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaccc53399b265d3400fb04a9717413514aa5177cf922c7443b6c8acb0751e93b6c
hovercard-subject-tagissue:1976427377
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/1728/issue_layout
twitter:imagehttps://opengraph.githubassets.com/346def8aeb86991e9a4e7a66dccc93a1b90df613981795b7f872800177f79cd8/gitpython-developers/GitPython/issues/1728
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/346def8aeb86991e9a4e7a66dccc93a1b90df613981795b7f872800177f79cd8/gitpython-developers/GitPython/issues/1728
og:image:altBackground #1679 included improvements to a number of tests that are known to fail on some platforms, by marking them xfail instead of skip so they are still run and their status is reported, but w...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameEliahKagan
hostnamegithub.com
expected-hostnamegithub.com
Nonee25f416bb6d8a5f8624aad6cebc375ab2c50ac58f2175f32a7093325e66e5515
turbo-cache-controlno-preview
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release32212b8b3bddd6432b3b35d27c050b1c22bd8cca
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/issues/1728#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1728
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1728
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1728
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1728
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1728
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1728
Notifications https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 964 https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5k https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://github.com/gitpython-developers/GitPython
Issues 169 https://github.com/gitpython-developers/GitPython/issues
Pull requests 8 https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/gitpython-developers/GitPython/security
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1728
Insights https://github.com/gitpython-developers/GitPython/pulse
Code https://github.com/gitpython-developers/GitPython
Issues https://github.com/gitpython-developers/GitPython/issues
Pull requests https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/1728
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/1728
#1729https://github.com/gitpython-developers/GitPython/pull/1729
Overbroad xfail marks will eventually make CI failhttps://github.com/gitpython-developers/GitPython/issues/1728#top
#1729https://github.com/gitpython-developers/GitPython/pull/1729
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com/EliahKagan
https://github.com/EliahKagan
EliahKaganhttps://github.com/EliahKagan
on Nov 3, 2023https://github.com/gitpython-developers/GitPython/issues/1728#issue-1976427377
#1679https://github.com/gitpython-developers/GitPython/pull/1679
xfailhttps://docs.pytest.org/en/7.1.x/how-to/skipping.html#xfail-mark-test-functions-as-expected-to-fail
pytest markshttps://docs.pytest.org/en/latest/how-to/mark.html
GitPython/test/test_util.pyhttps://github.com/gitpython-developers/GitPython/blob/340da6d39397253da8d0807179b0ecb5952effca/test/test_util.py#L221-L228
340da6dhttps://github.com/gitpython-developers/GitPython/commit/340da6d39397253da8d0807179b0ecb5952effca
GitPython/test/test_util.pyhttps://github.com/gitpython-developers/GitPython/blob/340da6d39397253da8d0807179b0ecb5952effca/test/test_util.py#L233-L245
340da6dhttps://github.com/gitpython-developers/GitPython/commit/340da6d39397253da8d0807179b0ecb5952effca
#1679https://github.com/gitpython-developers/GitPython/pull/1679
expectedhttps://docs.pytest.org/en/7.1.x/how-to/skipping.html#raises-parameter
an optional strict parameterhttps://docs.pytest.org/en/7.1.x/how-to/skipping.html#strict-parameter
pytest-dev/pytest#11467https://github.com/pytest-dev/pytest/issues/11467
8.0 milestonehttps://github.com/pytest-dev/pytest/milestone/35
pytest-dev/pytest#11499https://github.com/pytest-dev/pytest/pull/11499
may eventuallyhttps://github.com/pytest-dev/pytest/issues/11467#issuecomment-1733852526
#1679https://github.com/gitpython-developers/GitPython/pull/1679
#1700 (comment)https://github.com/gitpython-developers/GitPython/pull/1700#discussion_r1353654395
#1725https://github.com/gitpython-developers/GitPython/pull/1725
#1726 (comment)https://github.com/gitpython-developers/GitPython/pull/1726#issuecomment-1791541248
#1679https://github.com/gitpython-developers/GitPython/pull/1679
#1700https://github.com/gitpython-developers/GitPython/pull/1700
#790https://github.com/gitpython-developers/GitPython/issues/790
plannedhttps://github.com/gitpython-developers/GitPython/pull/1654#issuecomment-1717239735
#1729https://github.com/gitpython-developers/GitPython/pull/1729
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.