Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow placeholder functions to compile #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 58 additions & 28 deletions mamba/__init__.py
Original file line number Diff line number Diff line change
@@ -1,57 +1,87 @@
"""Initialize the mamba module."""

__version__ = '0.9.3'
__all__ = [
"description", "_description", "fdescription",
"describe", "_describe", "fdescribe",
"it", "_it", "fit",
"context", "_context", "fcontext",
]


class Noop(object):

def __enter__(self):
return self

def __exit__(self, type, value, traceback):
return True


def description(message):
pass
class BeforeAfter(object):
def __init__(self):
self.each = Noop()


def _description(message):
pass
def description(message, tag=None):
"""Create a new logical grouping of specs."""
return Noop()


def fdescription(message):
pass
def _description(message, tag=None):
"""Create a new logical grouping of disabled specs."""
return Noop()


def describe(message):
pass
def fdescription(message, tag=None):
"""Create a new logical grouping of focused specs."""
return Noop()


def _describe(message):
pass
def describe(message, tag=None):
"""Create a new logical grouping of specs."""
return Noop()


def fdescribe(message):
pass
def _describe(message, tag=None):
"""Create a new logical grouping of disabled specs."""
return Noop()


def it(message):
pass
def fdescribe(*args):
"""Create a new logical grouping of focused specs."""
return Noop()


def _it(message):
pass
def it(message, tag=None):
"""Create a new spec."""
raise NotImplementedError()


def fit(message):
pass
def _it(message, tag=None):
"""Create a new disabled spec."""
raise NotImplementedError()


def context(message):
pass
def fit(message, tag=None):
"""Create a new focused spec."""
raise NotImplementedError()


def _context(message):
pass
def context(message, tag=None):
"""Create a new logical sub-grouping of specs."""
return Noop()


def fcontext(message):
pass
def _context(message, tag=None):
"""Create a new logical sub-grouping of disabled specs."""
return Noop()


def before():
pass
def fcontext(message, tag=None):
"""Create a new logical sub-grouping of focused specs."""
return Noop()


def after():
pass
before = BeforeAfter()
after = BeforeAfter()