Title: TestGit.test_refresh changes Git.GIT_PYTHON_GIT_EXECUTABLE for other tests · Issue #1811 · gitpython-developers/GitPython · GitHub
Open Graph Title: TestGit.test_refresh changes Git.GIT_PYTHON_GIT_EXECUTABLE for other tests · Issue #1811 · gitpython-developers/GitPython
X Title: TestGit.test_refresh changes Git.GIT_PYTHON_GIT_EXECUTABLE for other tests · Issue #1811 · gitpython-developers/GitPython
Description: In test_git.py, TestGit.test_refresh tests the behavior of git.refresh when called with bad (nonexistent) and good (existing and usable) explicit path arguments. With the bad path, there could only be a lasting change to Git.GIT_PYTHON_G...
Open Graph Description: In test_git.py, TestGit.test_refresh tests the behavior of git.refresh when called with bad (nonexistent) and good (existing and usable) explicit path arguments. With the bad path, there could only...
X Description: In test_git.py, TestGit.test_refresh tests the behavior of git.refresh when called with bad (nonexistent) and good (existing and usable) explicit path arguments. With the bad path, there could only...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1811
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TestGit.test_refresh changes Git.GIT_PYTHON_GIT_EXECUTABLE for other tests","articleBody":"In `test_git.py`, `TestGit.test_refresh` tests the behavior of `git.refresh` when called with bad (nonexistent) and good (existing and usable) explicit `path` arguments.\r\n\r\n- With the bad path, there could only be a lasting change to `Git.GIT_PYTHON_GIT_EXECUTABLE` or other global state due to a bug in `git.refresh`, or in `git.cmd.Git.refresh` or some other code `git.refresh` uses.\r\n- **But with the good path, it remains set as `Git.GIT_PYTHON_GIT_EXECUTABLE`**, and tests that run after `test_refresh` use that instead of the original value that (when tests are run normally in an environment that supports them) is usually `\"git\"`.\r\n\r\nhttps://github.com/gitpython-developers/GitPython/blob/307f1987596a99fb7b7192d8a5308a0df736ca7b/test/test_git.py#L309-L316\r\n\r\n```text\r\n\u003e\u003e\u003e from git import Git\r\n\u003e\u003e\u003e from test.test_git import TestGit\r\n\u003e\u003e\u003e t = TestGit()\r\n\u003e\u003e\u003e Git.GIT_PYTHON_GIT_EXECUTABLE\r\n'git'\r\n\u003e\u003e\u003e t.test_refresh()\r\n\u003e\u003e\u003e Git.GIT_PYTHON_GIT_EXECUTABLE\r\n'C:\\\\Users\\\\ek\\\\scoop\\\\shims\\\\git.exe'\r\n```\r\n\r\n(That was run on Windows, but the effect is not specific to Windows.)\r\n\r\nAlthough the good-path code can be simplified in the way it finds the absolute path it tests, that is not the cause of this.\r\n\r\n**In the absence of bugs in the code under test**, this change to `Git.GIT_PYTHON_GIT_EXECUTABLE` between some tests and others should make no difference on most working test systems, because both the old and new paths should both work and typically run the same `git` installation. However, if there are bugs related to this attribute that the test suite should reveal or that otherwise interact with tests, then I think this may lead to inaccurate or less useful results, or complicate troubleshooting.","author":{"url":"https://github.com/EliahKagan","@type":"Person","name":"EliahKagan"},"datePublished":"2024-01-25T09:12:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1811/GitPython/issues/1811"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6407b129-5e79-4a2a-42da-e25e075495d8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 803C:8F8A3:74A8A0:A0AC1F:6968AE93 |
| html-safe-nonce | 52453230bb778dd241bb3875669c0f83a04834e10554be6437562a4bf3808d89 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDNDOjhGOEEzOjc0QThBMDpBMEFDMUY6Njk2OEFFOTMiLCJ2aXNpdG9yX2lkIjoiNDE4OTAyNDYxNTA4MzMyMzAyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d8149465726faa3205dfe6c0c5f8565c2df84b758f18bd9d4d60f0a228b2eb6a |
| hovercard-subject-tag | issue:2099916573 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/gitpython-developers/GitPython/1811/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ffcbaf7269d4782b60b5e4d93ff8628ff7b2bd0938ac1035d796b2c69fc76d30/gitpython-developers/GitPython/issues/1811 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ffcbaf7269d4782b60b5e4d93ff8628ff7b2bd0938ac1035d796b2c69fc76d30/gitpython-developers/GitPython/issues/1811 |
| og:image:alt | In test_git.py, TestGit.test_refresh tests the behavior of git.refresh when called with bad (nonexistent) and good (existing and usable) explicit path arguments. With the bad path, there could only... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EliahKagan |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdc7c66bd36a6c12eb8e771e806db863266e573fc299e77f27505a768d4f8a98 |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3223a6503d318917691422cdadfbe16cd8fb21e5 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width