Title: Reorganize test_util and make xfail marks precise by EliahKagan · Pull Request #1729 · gitpython-developers/GitPython · GitHub
Open Graph Title: Reorganize test_util and make xfail marks precise by EliahKagan · Pull Request #1729 · gitpython-developers/GitPython
X Title: Reorganize test_util and make xfail marks precise by EliahKagan · Pull Request #1729 · gitpython-developers/GitPython
Description: Fixes #1728 This makes xfail markings precise in the test suite, so that only tests that are expected to fail (and do fail on CI) are marked xfail. This addresses both the general problem that spurious XPASS statuses make the information from xfail-marked tests less informative, and the specific problem focused on in #1728. In addition, this also refactors some other recently added tests in test_util.py, to achieve the goals described there. I may soon propose other changes that build on this in other ways, but that is not included here. Basically, this just: Reorganizes the tests in test_util.py, making some of them pure pytest tests. Uses @pytest.mark.parametrize with the marks= argument to apply @pytest.mark.xfail to exactly the cases that currently need it, and no others. Refactors some of the other tests' use of ad-hoc fixtures, removing some code reuse that I had added that was making the code harder rather than easier to maintain, and achieving useful code reuse more cleanly with a custom pytest fixture. This includes two changes to the pytest plugins that are used. Since those affect development dependencies, I list them here with their rationales: Because the parametrized mark supports nesting, generating test cases for the Cartesian product of the specified parameters, I removed the use of subtests for now, and thus also the pytest-subtests development dependency. Subtests, and that plugin, could be brought back in the future if they prove useful for another reason, but right now there are no longer any subtests in the test suite. This is the change I had anticipated in #1700 (comment). I have added and used pytest-mock for some of the new pure pytest tests that had previously used nested with-statements. The pytest-mock plugin provides a mocker fixture that wraps the functionality of unittest.mock but automatically unpatches everything (and in the reverse order in which it was patched) after the test. Since we do not yet have CI for native Windows, I have manually run the test_util.py tests on Windows (on Windows 10, with Python 3.12) to verify that they produce the expected statuses (including no FAIL statuses).
Open Graph Description: Fixes #1728 This makes xfail markings precise in the test suite, so that only tests that are expected to fail (and do fail on CI) are marked xfail. This addresses both the general problem that spur...
X Description: Fixes #1728 This makes xfail markings precise in the test suite, so that only tests that are expected to fail (and do fail on CI) are marked xfail. This addresses both the general problem that spur...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1729
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:c087ab42-e8e7-7c83-3f9c-02445cf3920a |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 8E96:2E86FE:4846:6463:6968E52B |
| html-safe-nonce | 7e462163dbe398d8840a72ccfddab61b9f51cc36b8303eacc68dc049923493cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTk2OjJFODZGRTo0ODQ2OjY0NjM6Njk2OEU1MkIiLCJ2aXNpdG9yX2lkIjoiMzA2MzE4NzI4NTkxNDIxNTcyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 65d6d5253844fc5933d9651dd2e2e509e94a6760b774bb259f35257fcdc81be2 |
| hovercard-subject-tag | pull_request:1586314663 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/1729/checks |
| twitter:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| og:image:alt | Fixes #1728 This makes xfail markings precise in the test suite, so that only tests that are expected to fail (and do fail on CI) are marked xfail. This addresses both the general problem that spur... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5416305695900bdab7d289f90ea3d96bf36397112f2ab16f5a5a120f38de085 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 366035abf3d5b1e31841c97e2fa2ce02a3007a7b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width