Giter Site home page Giter Site logo

pytest-voluptuous's People

Contributors

bjoluc avatar rytilahti avatar turbo87 avatar tuukkamustonen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytest-voluptuous's Issues

Assertion hook doesn't work

Hello,

With Pytest 7.1 and Pytest-voluptuous 1.2.0, I don't get the proper assertion hook with assert S(schema) == some_dict:

Test session starts (platform: linux, Python 3.10.3, pytest 7.1.1, pytest-sugar 0.9.4)
cachedir: .pytest_cache
django: settings: ward_run_app.test_settings (from option)
rootdir: /app
plugins: Faker-13.3.4, forked-1.4.0, timeout-2.1.0, voluptuous-1.2.0, cov-3.0.0, xdist-2.5.0, profiling-1.7.0, sugar-0.9.4, icdiff-0.5, django-4.5.2, socket-0.5.1

    assert S(SCHEMA) == dict(data)
E   AssertionError: assert equals failed
E     <Schema({'id': <class 'int'>}, extra=PREVENT_EXTRA,
E required=True) 
E. object at 0xffff817f5f90>
E                                                                              {
E                                                                               'id': "hello"
E                                                                               }

Add ExactSequence

When checking exact values exist in a dictionary containing a list, rather than types, currently you need to import ExactSequence from voluptuous. Can it be added as a function in pytest_voluptuous as well?

Show actual values

E       AssertionError: assert failed to validation error(s):
E         - results.flight.id: not a valid value for dictionary value @ data['results']['flight']['id']

It's nice that it shows me what values specifically do not comply with the schema, but it would be awesome if it could also show the actual value so that failing tests are easier to debug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.