notion / dado Goto Github PK
View Code? Open in Web Editor NEWData-driven test decorator
License: Apache License 2.0
Data-driven test decorator
License: Apache License 2.0
setup.py, for reasons I can't find, doesn't recognize wheel-only distributions as installable - it requires source distributions.
flit, for reasons outlined here, intentionally doesn't build source distributions.
The combination means that anyone who wants to use this library in a module they wish to distribute with setup.py can't.
classic error - the modules dict is defined at import time as a default, so if dado happens to be imported before the targeted test module, that module won't show up and dado will freak out when it's called and tries to update the calling module.
at https://github.com/notion/dado/blob/master/dado/dado.py#L63 - the build_test
function both builds the function, and builds the function's new name, and then returns both as a tuple.
It should set the function's name on the function and just return the function. The caller can then set that function in the module like setattr(module, func.__name__, func)
as in, if the user forgets to pass a list of arguments in their test (data_driven(['foo'], {'first': foo})
instead of data_driven(['foo'], {'first': [foo]})
), we should give them a better error than:
File ".../lib/python3.5/site-packages/dado/dado.py", line 63, in dd_decorator
new_test, new_name = build_test(test, suffix, names, args)
File ".../lib/python3.5/site-packages/dado/dado.py", line 50, in build_test
kwargs = {k: v for k, v in zip(arg_names, args)}
TypeError: zip argument #2 must support iteration
Make the dado calls stackable, so that you can create a test matrix like
@data_driven(['foo'], <4 options for foo>)
@data_driven(['bar'], <5 options for bar>)
def test_combo(...
instead of
@data_driven(['foo', 'bar'], <20 options for foo, bar>)
def test_combo(...
right now they're partials, which some python inspection tools don't count as functions.
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.