Code Monkey home page Code Monkey logo

vampytest's Introduction

Huyane Matsu

New innovative programming disciplines, frameworks and products, I create new code.



I am a professional Python developer.

vampytest's People

Contributors

albertopoljak avatar huyanematsu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

albertopoljak

vampytest's Issues

Assert raises where

vampytest.assert_raises should accept a where parameter that is used as a condition.

def test_pepe():
    with vampytest.assert_raises(RuntimeError, where = lambda err: 'nue' in repr(err)):
        action()

Call with but from generator

There should be a vampytest.call_with alternative that works from a generator.

def generator():
    yield 1, 2
    yield 2, 3

@vampytest.new_stuff(generator)
def test_koishi(p0, p1):
    pass

Auto detect package root

The currently tested package should be auto detected instead of being required to manually define it.

This would allow greater flexibility when using vampytest, as you would not need to define the package directory as a parameter.

Capture io

stdout and stderr should be captured. This would catch stray print and .write code. Would also catch warnings. If a test's io is captured it should show up at the end of the output above the failing ones.

Separate sub tests

Sub test should show up separately on the output and also should be included in the counting like that as well.

Io context manager

Add a context manager to capture stdout and stderr.

def test_pepe():
    io_capture = vampytest.capture_io()
    
    with io_capture:
        pass
    
    value = io_capture.get_value()

Support rich dictionary rendering

When dictionaries are checked for equality or inequality, and they fail then detailed difference should also be rendered.

Example:

... Normal output ...

Common items:
{
    ....,
    ....,
 }
 Different items:
 {
 +   ....
 +   ...,
 -   ...,
 -   ...,
 }

+ should mark the values that parameter_0 has and - that parameter_1 has. If a value is different in both, then first + should be rendered followed by its - counterpart.

The output should be sorted.

Rename revert

revert actually reverses a test's result and not reverts it. Should be renamed.

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.