Last active
December 31, 2019 11:51
-
-
Save sanscore/d371763f8e88052891b16b4d65a1d2a8 to your computer and use it in GitHub Desktop.
print(...) tracing for pytest.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
import pytest | |
def pytest_addhooks(pluginmanager): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_namespace(): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_plugin_registered(plugin, manager): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_addoption(parser): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_configure(config): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_cmdline_parse(pluginmanager, args): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_cmdline_preparse(config, args): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_cmdline_main(config): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_load_initial_conftests(early_config, parser, args): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_collection(session): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_collection_modifyitems(session, config, items): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_collection_finish(session): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_ignore_collect(path, config): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_collect_directory(path, parent): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_collect_file(path, parent): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_collectstart(collector): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_itemcollected(item): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_collectreport(report): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_deselected(items): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_make_collect_report(collector): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_pycollect_makemodule(path, parent): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_pycollect_makeitem(collector, name, obj): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_pyfunc_call(pyfuncitem): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_generate_tests(metafunc): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_make_parametrize_id(config, val): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtestloop(session): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_itemstart(item, node): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtest_protocol(item, nextitem): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtest_logstart(nodeid, location): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtest_logfinish(nodeid, location): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtest_setup(item): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtest_call(item): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtest_teardown(item, nextitem): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtest_makereport(item, call): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_runtest_logreport(report): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_fixture_setup(fixturedef, request): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_fixture_post_finalizer(fixturedef): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_sessionstart(session): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_sessionfinish(session, exitstatus): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_unconfigure(config): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_assertrepr_compare(config, op, left, right): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_report_header(config, startdir): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_report_teststatus(report): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_terminal_summary(terminalreporter, exitstatus): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_logwarning(message, code, nodeid, fslocation): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_doctest_prepare_content(content): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_internalerror(excrepr, excinfo): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_keyboard_interrupt(excinfo): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_exception_interact(node, call, report): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_enter_pdb(config): | |
print(inspect.currentframe().f_code.co_name) | |
@pytest.fixture(autouse=True) | |
def auto_fixture(request): | |
print(inspect.currentframe().f_code.co_name) | |
@pytest.fixture(scope='session') | |
def session_fixture(request): | |
print(inspect.currentframe().f_code.co_name) | |
@pytest.fixture(scope='module') | |
def module_fixture(request): | |
print(inspect.currentframe().f_code.co_name) | |
@pytest.fixture(scope='class') | |
def class_fixture(request): | |
print(inspect.currentframe().f_code.co_name) | |
@pytest.fixture | |
def function_fixture(request): | |
print(inspect.currentframe().f_code.co_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
def test_trace(session_fixture, module_fixture, class_fixture, function_fixture): | |
print(inspect.currentframe().f_code.co_name) |
Author
sanscore
commented
Apr 2, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment