GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Database fixtures considered harmful. · Issue #116 · dry-python/dry-python.github.io

Database fixtures considered harmful. #116

New issue
Copy link
New issue
Copy link
Open
Open
Database fixtures considered harmful.#116
Copy link
Labels
blog

Description

@proofit404
proofit404
opened on Jul 1, 2019
Issue body actions

An article about better test fixtures

  • dependencies can turn stories business objects into pytest fixtures.
  • We will write better tests because our database fills up logic does not duplicate in FactoryBoy.
  • @value decorator can be used to return normal results from the factories.
@register
class SubmitCodeFixture(SubmitCode):

    name = 'submit_code'

    @value
    def fixture(submit_code, user, token):
        return submit_code(user, token)

    user = require('request_code')

    token = Faker('uuid')
  • profit: Tests coupled with business logic will fail if this logic changes. On the other side, we'll need to change each FactoryBoy usage in our test suite to mirror actual behavior.

Activity

  1. proofit404
    changed the title [-][Blog] Database fixtures considered harmful.[/-] [+]Database fixtures considered harmful.[/+] on Jul 21, 2019
  2. proofit404
    added
    blog
    on Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blog

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.