
import pytest
from acolyte import create_app
from acolyte.database import db
from config import TestConfig, TestConfigCRSF


@pytest.yield_fixture(scope='function')
def app(request):
    app = create_app(TestConfig)
    app.app_context().push()
    db.create_all()

    yield app


@pytest.yield_fixture(scope='function')
def client(app):
    result = app.test_client()

    yield result


@pytest.yield_fixture(scope='function')
def client_with_crsf(app):
    app = create_app(TestConfigCRSF)
    app.app_context().push()
    result = app.test_client()

    yield result




import pytest
from acolyte import create_app
from acolyte.database import db
from config import TestConfig, TestConfigCRSF


@pytest.yield_fixture(scope='function')
def app():
    """Pytest fixture to yield a fully initialised Acolyte
    
    Decorators:
        pytest
    
    Yields:
        obj -- Fully initialised Acolyte application
    """

    result = create_app(TestConfig)
    result.app_context().push()
    db.create_all()

    yield result


@pytest.yield_fixture(scope='function')
def client(app):
    """Pytest fixture to yield Flask test client for
    initialised Acolyte application
    
    Decorators:
        pytest
    
    Arguments:
        app {obj} -- Initialised Acolyte application
    
    Yields:
        obj -- Flask test client
    """

    result = app.test_client()

    yield result


@pytest.yield_fixture(scope='function')
def client_with_crsf():
    """Pytest fixture that yields Flask test client for
    Acolyte application initialised with CRSF testing
    
    Decorators:
        pytest
    
    Yields:
        obj -- Flask test client
    """

    ap = create_app(TestConfigCRSF)
    ap.app_context().push()
    result = ap.test_client()

    yield result

Add docstrings to test fixtures
Add docstrings to test fixtures

+ 
  
  import pytest
  from acolyte import create_app
  from acolyte.database import db
  from config import TestConfig, TestConfigCRSF
  
  
  @pytest.yield_fixture(scope='function')
- def app(request):
+ def app():
+     """Pytest fixture to yield a fully initialised Acolyte
+     
+     Decorators:
+         pytest
+     
+     Yields:
+         obj -- Fully initialised Acolyte application
+     """
+ 
-     app = create_app(TestConfig)
+     result = create_app(TestConfig)
-     app.app_context().push()
+     result.app_context().push()
      db.create_all()
  
-     yield app
+     yield result
  
  
  @pytest.yield_fixture(scope='function')
  def client(app):
+     """Pytest fixture to yield Flask test client for
+     initialised Acolyte application
+     
+     Decorators:
+         pytest
+     
+     Arguments:
+         app {obj} -- Initialised Acolyte application
+     
+     Yields:
+         obj -- Flask test client
+     """
+ 
      result = app.test_client()
  
      yield result
  
  
  @pytest.yield_fixture(scope='function')
- def client_with_crsf(app):
+ def client_with_crsf():
+     """Pytest fixture that yields Flask test client for
+     Acolyte application initialised with CRSF testing
+     
+     Decorators:
+         pytest
+     
+     Yields:
+         obj -- Flask test client
+     """
+ 
-     app = create_app(TestConfigCRSF)
+     ap = create_app(TestConfigCRSF)
-     app.app_context().push()
+     ap.app_context().push()
-     result = app.test_client()
+     result = ap.test_client()
  
      yield result
  
- 
Add docstrings to test fixtures
## Code Before:

import pytest
from acolyte import create_app
from acolyte.database import db
from config import TestConfig, TestConfigCRSF


@pytest.yield_fixture(scope='function')
def app(request):
    app = create_app(TestConfig)
    app.app_context().push()
    db.create_all()

    yield app


@pytest.yield_fixture(scope='function')
def client(app):
    result = app.test_client()

    yield result


@pytest.yield_fixture(scope='function')
def client_with_crsf(app):
    app = create_app(TestConfigCRSF)
    app.app_context().push()
    result = app.test_client()

    yield result


## Instruction:
Add docstrings to test fixtures
## Code After:


import pytest
from acolyte import create_app
from acolyte.database import db
from config import TestConfig, TestConfigCRSF


@pytest.yield_fixture(scope='function')
def app():
    """Pytest fixture to yield a fully initialised Acolyte
    
    Decorators:
        pytest
    
    Yields:
        obj -- Fully initialised Acolyte application
    """

    result = create_app(TestConfig)
    result.app_context().push()
    db.create_all()

    yield result


@pytest.yield_fixture(scope='function')
def client(app):
    """Pytest fixture to yield Flask test client for
    initialised Acolyte application
    
    Decorators:
        pytest
    
    Arguments:
        app {obj} -- Initialised Acolyte application
    
    Yields:
        obj -- Flask test client
    """

    result = app.test_client()

    yield result


@pytest.yield_fixture(scope='function')
def client_with_crsf():
    """Pytest fixture that yields Flask test client for
    Acolyte application initialised with CRSF testing
    
    Decorators:
        pytest
    
    Yields:
        obj -- Flask test client
    """

    ap = create_app(TestConfigCRSF)
    ap.app_context().push()
    result = ap.test_client()

    yield result
