issues: 396215043
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | pull_request | body | repo | type | active_lock_reason | performed_via_github_app | reactions | draft | state_reason |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
396215043 | MDU6SXNzdWUzOTYyMTUwNDM= | 395 | Find a cleaner pattern for fixtures with arguments | 9599 | closed | 0 | 1 | 2019-01-06T00:31:22Z | 2020-06-07T21:23:22Z | 2020-06-07T21:23:22Z | OWNER | A lot of Datasette tests look like this: The loop here isn't actually expected to loop - it's there because the This pattern works, but it is a little confusing. It would be nice to replace it with something less strange looking. The answer may be to switch to the "factories as fixtures" pattern described here: https://docs.pytest.org/en/latest/fixture.html#factories-as-fixtures In particular some variant of this example: ``` @pytest.fixture def make_customer_record():
def test_customer_records(make_customer_record): customer_1 = make_customer_record("Lisa") customer_2 = make_customer_record("Mike") customer_3 = make_customer_record("Meredith") ``` |
107914493 | issue | { "url": "https://api.github.com/repos/simonw/datasette/issues/395/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed |