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

FrameworkError When Reusing CementApp Object #415

akhilman opened this Issue Nov 29, 2016 · 1 comment


None yet
2 participants

akhilman commented Nov 29, 2016

I'm writing unittests and got hit by this behaviour:

from import CementApp

def pre_setup(app):

    app.extend('object', object)

class BugyApp(CementApp):

    class Meta:

        label = 'bugy'

        hooks = [
            ('pre_setup', pre_setup),

# in case of unittests app is provided by CementTestCase
app = BugyApp()

# first app initialisation
with app:


# re-initialisation to check state loading
with app:


Executing this code will raise:

<class 'object'>
Traceback (most recent call last):
  File "", line 28, in <module>
    with app:
  File "/home/ildar/projects/slivoglot-1/cement/cement/core/", line 1494, in __enter__
  File "/home/ildar/projects/slivoglot-1/cement/cement/core/", line 843, in setup
    for res in'pre_setup', self):
  File "/home/ildar/projects/slivoglot-1/cement/cement/core/", line 150, in run
    res = hook[2](*args, **kwargs)
  File "", line 6, in pre_setup
    app.extend('object', object)
  File "/home/ildar/projects/slivoglot-1/cement/cement/core/", line 793, in extend
cement.core.exc.FrameworkError: App member 'object' already exists!

Second app initialisation tries to extend already extended app with object member.

akhilman added a commit to akhilman/cement that referenced this issue Nov 29, 2016

Fix for datafolklabs#415. app.extend and reusing app
Removing all extended members from app during close()

derks added a commit that referenced this issue Nov 29, 2016

Merge pull request #416 from akhilman/bug/415
Fix for #415. app.extend and reusing app

@derks derks changed the title from app.extend and reusing app fault to FrameworkError When Reusing CementApp Object Nov 29, 2016

@derks derks self-assigned this Nov 29, 2016

@derks derks added this to the 2.12.0 Stable milestone Nov 29, 2016

@derks derks closed this Nov 29, 2016

@derks derks added 4 - Done and removed 2 - Working <= 5 labels Nov 29, 2016


This comment has been minimized.


derks commented Nov 29, 2016

Thanks @akhilman!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment