New-style classes implemented for python 2.7 - #2147

This commit is contained in:
Michal Wajszczuk
2017-02-16 19:41:51 +01:00
parent da828aac05
commit fb0b90646e
61 changed files with 351 additions and 349 deletions

View File

@@ -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():