Metadata-Version: 1.1
Name: mete0r.testfixture
Version: 0.0.1
Summary: a testfixture helper
Home-page: https://github.com/mete0r/testfixture
Author: mete0r
Author-email: mete0r@sarangbang.or.kr
License: GNU Affero General Public License v3 or later (AGPLv3+)
Description: mete0r.testfixture
        ==================
        
        a testfixture helper
        
        
        Quickstart
        ----------
        
        To install::
        
           pip install mete0r.testfixture
        
        
        Let's assume your project has following structure::
        
           yourproject/
               setup.py
               yourpackage/
                   __init__.py
                   tests/
                       __init__.py
                       test_foo.py
                       fixtures/
                           foo.py
                           bar.py
        
        
        Define a fixture in ``yourpackage/tests/fixtures/foo.py``::
        
           from mete0r_testfixture.testfixture import testfixture
        
           @testfixture('Foo')
           def foo(fixtures):
               return {
                   'foo': None,
               }
        
        Define another fixture in ``yourpackage/tests/fixtures/bar.py``::
        
            @testfixture('Bar', 'foo')
            def bar(fixtures):
                return {
                    'bar': fixtures.get('Foo')
                }
        
        Now you can use them in your tests::
        
            # yourpackage/tests/test_foo.py
            from unittest import TestCase
            from mete0r_testfixture.testfixture import TestFixtures
            from . import fixtures
        
            class FooTest(TestCase):
        
                def test_foo(self):
                    testfixtures = TestFixtures('yourpackage.tests.fixtures')
                    self.assertEquals({
                        'bar': {
                            'foo': None,
                        },
                    }, testfixtures.get('Bar', 'foo')
        
        
        You can also list test fixtures defined in your packages::
        
           $ mete0r-testfixture-scan yourpackage
           Foo	        yourpackage.tests.fixtures.foo.foo
           Bar, foo	yourpackage.tests.fixtures.bar.bar
        
        
        Caveat
        ------
        
        ``mete0r.testfixture`` uses `venusian`_ to scan fixtures, so be careful not to
        scan test fixtures in your main application/package. For example::
        
           config = Configurator(...)  # pyramid configurator
           ...
           config.scan(ignore=[b'yourpackage.tests'])
        
        .. _venusian: https://pypi.python.org/pypi/venusian
        
        
        Development environment
        -----------------------
        
        To setup development environment::
        
           python setup.py virtualenv
           make
        
        Changes
        =======
        
        0.0.1 (2017-04-08)
        ------------------
        
        - Changes usage.
        
        
        0.0.0 (2017-01-27)
        ------------------
        
        - Initial release.
        
Keywords: test fixture
Platform: UNKNOWN
Classifier: Development Status :: 1 - Planning
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: Jython
