nestorsalceda / mamba

The definitive testing tool for Python. Born under the banner of Behavior Driven Development (BDD).
http://nestorsalceda.github.io/mamba
MIT License
518 stars 65 forks source link

Allow placeholder functions to compile #109

Open andrewminer opened 6 years ago

andrewminer commented 6 years ago

The various "placeholder" functions in mamba/init.py don't actually match the signatures they will eventually have (e.g., they don't accept a tag), and don't return values which can be used in a with statement (i.e., no __enter__ or __exit__ methods). This causes fatal errors when trying to load a *_spec.py file as a standalone module.

This change stubs out the placeholder functions enough so that spec files load properly without actually doing anything.

andrewminer commented 6 years ago

As a little more color on why I want this... I'm currently working on some code which uses introspection to serialize objects. I've got a bunch of test classes defined in my _spec.py which don't load properly because the "placeholder" functions never get replaced when loading the _spec.py file as a stand-alone module. This change makes it so that I can load the _spec.py file as a module, and therefore load that module as part of my test.