withsecureopensource / pytest-voluptuous Goto Github PK
View Code? Open in Web Editor NEWA pytest plugin for asserting data against voluptuous schema
License: Other
A pytest plugin for asserting data against voluptuous schema
License: Other
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 }
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.