Title: Fixture editsdefaults is broken · Issue #872 · python-control/python-control · GitHub
Open Graph Title: Fixture editsdefaults is broken · Issue #872 · python-control/python-control
X Title: Fixture editsdefaults is broken · Issue #872 · python-control/python-control
Description: @pytest.fixture(scope="function") def editsdefaults(): restore = control.config.defaults.copy() yield control.config.defaults = restore.copy() The fixture replaces the global config.config.defaults with a copy after the yield. Other modu...
Open Graph Description: @pytest.fixture(scope="function") def editsdefaults(): restore = control.config.defaults.copy() yield control.config.defaults = restore.copy() The fixture replaces the global config.config.defaults...
X Description: @pytest.fixture(scope="function") def editsdefaults(): restore = control.config.defaults.copy() yield control.config.defaults = restore.copy() The fixture replaces the global config.confi...
Opengraph URL: https://github.com/python-control/python-control/issues/872
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fixture editsdefaults is broken","articleBody":"```\r\n@pytest.fixture(scope=\"function\")\r\ndef editsdefaults():\r\n restore = control.config.defaults.copy()\r\n yield\r\n control.config.defaults = restore.copy()\r\n```\r\n\r\nThe fixture replaces the global `config.config.defaults` with a *copy* after the yield.\r\nOther modules that have already imported `control.config.defaults` will still have their original reference.\r\n\r\nA proper restore should replace all items in dictionary separately instead.","author":{"url":"https://github.com/henklaak","@type":"Person","name":"henklaak"},"datePublished":"2023-02-25T15:31:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/872/python-control/issues/872"}
| 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:84274dcf-987a-879e-13d6-f4f3b6121345 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E618:4C179:999CD:D6622:697A5A7F |
| html-safe-nonce | c3c8be855dda0581f54dbe38f6baebefb7810625de24b5ea394baf97995cb188 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjE4OjRDMTc5Ojk5OUNEOkQ2NjIyOjY5N0E1QTdGIiwidmlzaXRvcl9pZCI6Ijc5NjU4OTYwNDkxODY5ODY2MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 68d3fedc956dfd7d13361f137cddf212156ae5a37a2395cff66adfea930b0e52 |
| hovercard-subject-tag | issue:1599742748 |
| 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/python-control/python-control/872/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b207fd4b9e01a9d3b81513aa0dbb99f9787e10df8bcd51f0ff2e07c8ef1e13ff/python-control/python-control/issues/872 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b207fd4b9e01a9d3b81513aa0dbb99f9787e10df8bcd51f0ff2e07c8ef1e13ff/python-control/python-control/issues/872 |
| og:image:alt | @pytest.fixture(scope="function") def editsdefaults(): restore = control.config.defaults.copy() yield control.config.defaults = restore.copy() The fixture replaces the global config.config.defaults... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | henklaak |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a55e2ee143d859545e2c830f5d97a7eb755ab6ff220f86ef3512eec99ded059 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-control/python-control git https://github.com/python-control/python-control.git |
| octolytics-dimension-user_id | 2285872 |
| octolytics-dimension-user_login | python-control |
| octolytics-dimension-repository_id | 22791752 |
| octolytics-dimension-repository_nwo | python-control/python-control |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22791752 |
| octolytics-dimension-repository_network_root_nwo | python-control/python-control |
| 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 | 851f5ced370c69961aafcb448748c1790b1af4f7 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width