Skip to content

Commit

Permalink
Remove FakePostGenerationDeclaration
Browse files Browse the repository at this point in the history
Unused since its introduction in
6f20207.

Reviewed-by: Jon Dufresne
  • Loading branch information
francoisfreitag committed Nov 25, 2020
1 parent f3dce54 commit f3775af
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions factory/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import collections

from . import declarations, enums, errors, utils
from . import enums, errors, utils

DeclarationWithContext = collections.namedtuple(
'DeclarationWithContext',
Expand Down Expand Up @@ -140,18 +140,6 @@ def __repr__(self):
return '<DeclarationSet: %r>' % self.as_dict()


class FakePostGenerationDeclaration(declarations.PostGenerationDeclaration):
"""A fake post-generation declaration, providing simply a hardcoded value.
Used to disable post-generation when the user has overridden a method.
"""
def __init__(self, value):
self.value = value

def call(self, instance, step, context):
return self.value


def parse_declarations(decls, base_pre=None, base_post=None):
pre_declarations = base_pre.copy() if base_pre else DeclarationSet()
post_declarations = base_post.copy() if base_post else DeclarationSet()
Expand Down

0 comments on commit f3775af

Please sign in to comment.