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 — Hypothesis integration · Issue #234 · dry-python/classes

Hypothesis integration #234

New issue
Copy link
New issue
Copy link
Open
Open
Hypothesis integration#234
Copy link
Labels
enhancementNew feature or requestNew feature or request

Description

@sobolevn
sobolevn
opened on Jun 20, 2021
Issue body actions

Right now we don't test classes with hypothesis at all.

But, I have a great idea (at least it seems to me like so) of adding a hypothesis plugin, similar to one we have in returns: https://github.com/dry-python/returns/blob/master/returns/contrib/hypothesis/laws.py

What should it do?

  • check_typeclass(typeclass_instance) will check that for all existing types and protocols some valid return type is produced. For example, @typeclass def some(instance) -> str must produce str for all instance, protocol, and supported types and it must produce NotImplementedError for types that are not supported
  • Looks like check_typeclass must have allow_instances, allow_protocols, allow_unknown kw bool arguments to configure what types we actually need in a resulting strategy

It would be a nice companion to our mypy check.

@Zac-HD do you like it? Maybe you have any other ideas?

Reacted by emeinhardt

Activity

  1. sobolevn
    added
    enhancementNew feature or requestNew feature or request
    on Jun 20, 2021
  2. Zac-HD commented on Jul 2, 2021

    @Zac-HD
    Zac-HD
    on Jul 2, 2021
    More actions

    Sounds cool!

    My only real suggestion is a terminology note: "hypothesis plugin" usually refers to code that Hypothesis invokes via a setuptools entry point; so maybe call this kind of thing a "hypothesis extension" or "hypothesis integration" or "automatic testing tool"?

  3. sobolevn commented on Jul 2, 2021

    @sobolevn
    sobolevn
    on Jul 2, 2021
    MemberAuthor
    More actions

    "hypothesis integration"

    I like that! Thanks for the suggestion 👍

    Reacted by Zac Hatfield-Dodds
  4. sobolevn
    changed the title [-]Hypothesis plugin[/-] [+]Hypothesis integration[/+] on Jul 2, 2021
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

    enhancementNew feature or requestNew feature or request

    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.