remove pytest_namespace from recwarn and fixture decorators
This commit is contained in:
		
							parent
							
								
									794fd5658c
								
							
						
					
					
						commit
						c74103f395
					
				|  | @ -52,8 +52,6 @@ def pytest_namespace(): | ||||||
|         'function': pytest.Item, |         'function': pytest.Item, | ||||||
|     }) |     }) | ||||||
|     return { |     return { | ||||||
|         'fixture': fixture, |  | ||||||
|         'yield_fixture': yield_fixture, |  | ||||||
|         'collect': {'_fillfuncargs': fillfixtures} |         'collect': {'_fillfuncargs': fillfixtures} | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,11 +26,6 @@ def recwarn(): | ||||||
|         yield wrec |         yield wrec | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def pytest_namespace(): |  | ||||||
|     return {'deprecated_call': deprecated_call, |  | ||||||
|             'warns': warns} |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def deprecated_call(func=None, *args, **kwargs): | def deprecated_call(func=None, *args, **kwargs): | ||||||
|     """ assert that calling ``func(*args, **kwargs)`` triggers a |     """ assert that calling ``func(*args, **kwargs)`` triggers a | ||||||
|     ``DeprecationWarning`` or ``PendingDeprecationWarning``. |     ``DeprecationWarning`` or ``PendingDeprecationWarning``. | ||||||
|  |  | ||||||
|  | @ -12,6 +12,10 @@ __all__ = [ | ||||||
|     'register_assert_rewrite', |     'register_assert_rewrite', | ||||||
|     'freeze_includes', |     'freeze_includes', | ||||||
|     'set_trace', |     'set_trace', | ||||||
|  |     'warns', | ||||||
|  |     'deprecated_call', | ||||||
|  |     'fixture', | ||||||
|  |     'yield_fixture' | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| if __name__ == '__main__': # if run as a script or by 'python -m pytest' | if __name__ == '__main__': # if run as a script or by 'python -m pytest' | ||||||
|  | @ -25,11 +29,12 @@ from _pytest.config import ( | ||||||
|     main, UsageError, _preloadplugins, cmdline, |     main, UsageError, _preloadplugins, cmdline, | ||||||
|     hookspec, hookimpl |     hookspec, hookimpl | ||||||
| ) | ) | ||||||
|  | from _pytest.fixtures import fixture, yield_fixture | ||||||
| from _pytest.assertion import register_assert_rewrite | from _pytest.assertion import register_assert_rewrite | ||||||
| from _pytest.freeze_support import freeze_includes | from _pytest.freeze_support import freeze_includes | ||||||
| from _pytest import __version__ | from _pytest import __version__ | ||||||
| from _pytest.debugging import pytestPDB as __pytestPDB | from _pytest.debugging import pytestPDB as __pytestPDB | ||||||
| 
 | from _pytest.recwarn import warns, deprecated_call | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| set_trace = __pytestPDB.set_trace | set_trace = __pytestPDB.set_trace | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue