New-style classes implemented for python 2.7 - #2147
This commit is contained in:
@@ -16,7 +16,7 @@ def mp():
|
||||
|
||||
|
||||
def test_setattr():
|
||||
class A:
|
||||
class A(object):
|
||||
x = 1
|
||||
|
||||
monkeypatch = MonkeyPatch()
|
||||
@@ -39,7 +39,7 @@ def test_setattr():
|
||||
assert A.x == 5
|
||||
|
||||
|
||||
class TestSetattrWithImportPath:
|
||||
class TestSetattrWithImportPath(object):
|
||||
def test_string_expression(self, monkeypatch):
|
||||
monkeypatch.setattr("os.path.abspath", lambda x: "hello2")
|
||||
assert os.path.abspath("123") == "hello2"
|
||||
@@ -79,7 +79,7 @@ class TestSetattrWithImportPath:
|
||||
|
||||
|
||||
def test_delattr():
|
||||
class A:
|
||||
class A(object):
|
||||
x = 1
|
||||
|
||||
monkeypatch = MonkeyPatch()
|
||||
@@ -294,7 +294,7 @@ class SampleNewInherit(SampleNew):
|
||||
pass
|
||||
|
||||
|
||||
class SampleOld:
|
||||
class SampleOld(object):
|
||||
# oldstyle on python2
|
||||
@staticmethod
|
||||
def hello():
|
||||
|
||||
Reference in New Issue
Block a user