port _Compatproperty to attrs
This commit is contained in:
parent
afc607cfd8
commit
94608c6110
|
@ -1,12 +1,14 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
from collections import MutableMapping as MappingMixin
|
from collections import MutableMapping as MappingMixin
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import six
|
import six
|
||||||
import py
|
import py
|
||||||
|
import attr
|
||||||
|
|
||||||
import _pytest
|
import _pytest
|
||||||
|
|
||||||
|
|
||||||
SEP = "/"
|
SEP = "/"
|
||||||
|
|
||||||
tracebackcutdir = py.path.local(_pytest.__file__).dirpath()
|
tracebackcutdir = py.path.local(_pytest.__file__).dirpath()
|
||||||
|
@ -48,9 +50,9 @@ def ischildnode(baseid, nodeid):
|
||||||
return node_parts[:len(base_parts)] == base_parts
|
return node_parts[:len(base_parts)] == base_parts
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s
|
||||||
class _CompatProperty(object):
|
class _CompatProperty(object):
|
||||||
def __init__(self, name):
|
name = attr.ib()
|
||||||
self.name = name
|
|
||||||
|
|
||||||
def __get__(self, obj, owner):
|
def __get__(self, obj, owner):
|
||||||
if obj is None:
|
if obj is None:
|
||||||
|
|
Loading…
Reference in New Issue