@@ -47,12 +47,6 @@ def whitelist_check(path):
47
47
}
48
48
49
49
50
- def is_nose_class (cls ):
51
- """Check if supplied class looks like Nose testcase"""
52
- return any (name in ['setUp' , 'tearDown' ]
53
- for name , _ in inspect .getmembers (cls ))
54
-
55
-
56
50
def pytest_addoption (parser ):
57
51
group = parser .getgroup ("matplotlib" , "matplotlib custom options" )
58
52
@@ -80,23 +74,3 @@ def pytest_ignore_collect(path, config):
80
74
if path .ext == '.py' :
81
75
collect_filter = config .getoption ('--collect-filter' )
82
76
return COLLECT_FILTERS [collect_filter ](path )
83
-
84
-
85
- def pytest_pycollect_makeitem (collector , name , obj ):
86
- if inspect .isclass (obj ):
87
- if is_nose_class (obj ) and not issubclass (obj , unittest .TestCase ):
88
- # Workaround unittest-like setup/teardown names in pure classes
89
- setup = getattr (obj , 'setUp' , None )
90
- if setup is not None :
91
- obj .setup_method = lambda self , _ : obj .setUp (self )
92
- tearDown = getattr (obj , 'tearDown' , None )
93
- if tearDown is not None :
94
- obj .teardown_method = lambda self , _ : obj .tearDown (self )
95
- setUpClass = getattr (obj , 'setUpClass' , None )
96
- if setUpClass is not None :
97
- obj .setup_class = obj .setUpClass
98
- tearDownClass = getattr (obj , 'tearDownClass' , None )
99
- if tearDownClass is not None :
100
- obj .teardown_class = obj .tearDownClass
101
-
102
- return pytest .Class (name , parent = collector )
0 commit comments