from pytest import mark
from collections import namedtuple

from characteristic import Attribute
from characteristic import attributes

from fields import __base__
from fields import Fields


@attributes(["a", "b", Attribute("c", default_value="abc")])
class characteristic_class(object):
    pass


class fields_class(Fields.a.b.c["abc"]):
    pass

def make_super_dumb_class():
    class super_dumb_class(__base__):
        def __init__(self, a, b, c="abc"):
            self.a = a
            self.b = b
            self.c = c
            super(super_dumb_class, self).__init__(a=a, b=b, c=c)
    return super_dumb_class
super_dumb_class = make_super_dumb_class()

class dumb_class(object):
    def __init__(self, a, b, c="abc"):
        self.a = a
        self.b = b
        self.c = c

namedtuple_class = namedtuple("namedtuple_class", ["a", "b", "c"])


def test_characteristic(benchmark):
    with benchmark:
        assert characteristic_class(a=1, b=2, c=1)


def test_fields(benchmark):
    with benchmark:
        assert fields_class(a=1, b=2, c=1)


def test_super_dumb(benchmark):
    with benchmark:
        assert super_dumb_class(a=1, b=2, c=1)


def test_dumb(benchmark):
    with benchmark:
        assert dumb_class(a=1, b=2, c=1)

def test_namedtuple(benchmark):
    with benchmark:
        assert namedtuple_class(a=1, b=2, c=1)

@@ -1,28 +1,4 @@
-from pytest import mark%0A
 from
@@ -27,16 +27,71 @@
 medtuple
+%0Afrom functools import partial%0A%0Afrom pytest import mark
 %0A%0Afrom c
@@ -375,16 +375,18 @@
   pass%0A%0A
+%0A%0A
 def make
@@ -918,36 +918,38 @@
 benchmark):%0A    
-with
+assert
  benchmark:%0A    
@@ -942,33 +942,25 @@
 enchmark
-:%0A        assert 
+(partial(
 characte
@@ -967,25 +967,26 @@
 ristic_class
-(
+, 
 a=1, b=2, c=
@@ -979,32 +979,33 @@
 , a=1, b=2, c=1)
+)
 %0A%0A%0Adef test_fiel
@@ -1015,36 +1015,38 @@
 benchmark):%0A    
-with
+assert
  benchmark:%0A    
@@ -1039,33 +1039,25 @@
 enchmark
-:%0A        assert 
+(partial(
 fields_c
@@ -1056,25 +1056,26 @@
 fields_class
-(
+, 
 a=1, b=2, c=
@@ -1068,32 +1068,33 @@
 , a=1, b=2, c=1)
+)
 %0A%0A%0Adef test_supe
@@ -1108,36 +1108,38 @@
 benchmark):%0A    
-with
+assert
  benchmark:%0A    
@@ -1132,33 +1132,25 @@
 enchmark
-:%0A        assert 
+(partial(
 super_du
@@ -1149,33 +1149,34 @@
 super_dumb_class
-(
+, 
 a=1, b=2, c=1)%0A%0A
@@ -1173,16 +1173,17 @@
 =2, c=1)
+)
 %0A%0A%0Adef t
@@ -1199,36 +1199,38 @@
 benchmark):%0A    
-with
+assert
  benchmark:%0A    
@@ -1223,33 +1223,25 @@
 enchmark
-:%0A        assert 
+(partial(
 dumb_cla
@@ -1238,25 +1238,26 @@
 l(dumb_class
-(
+, 
 a=1, b=2, c=
@@ -1258,16 +1258,19 @@
 =2, c=1)
+)%0A%0A
 %0A%0Adef te
@@ -1303,12 +1303,14 @@
     
-with
+assert
  ben
@@ -1319,25 +1319,17 @@
 mark
-:%0A        assert 
+(partial(
 name
@@ -1340,17 +1340,18 @@
 le_class
-(
+, 
 a=1, b=2
@@ -1356,9 +1356,10 @@
 =2, c=1)
+)
 %0A

Upgrade benchmark code.