diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-08-16 03:28:34 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-08-16 03:28:34 +0100 |
commit | 643a5121202a0a33fb4d77fbf1c4dde26de3224c (patch) | |
tree | e7e4742e588a0ee9769303f80c6cfcf273360f9a /dev-python/pytest-system-statistics/files | |
parent | 3648761f2708fcf5662ea1b9585f594c36eefc30 (diff) |
gentoo auto-resync : 16:08:2023 - 03:28:34
Diffstat (limited to 'dev-python/pytest-system-statistics/files')
-rw-r--r-- | dev-python/pytest-system-statistics/files/pytest-system-statistics-1.0.2-loader.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dev-python/pytest-system-statistics/files/pytest-system-statistics-1.0.2-loader.patch b/dev-python/pytest-system-statistics/files/pytest-system-statistics-1.0.2-loader.patch new file mode 100644 index 000000000000..6d4751759617 --- /dev/null +++ b/dev-python/pytest-system-statistics/files/pytest-system-statistics-1.0.2-loader.patch @@ -0,0 +1,43 @@ +diff --git a/src/pytestsysstats/plugin.py b/src/pytestsysstats/plugin.py +index 4009858..3067f73 100644 +--- a/src/pytestsysstats/plugin.py ++++ b/src/pytestsysstats/plugin.py +@@ -231,20 +231,17 @@ def pytest_sessionstart(session: "Session") -> None: + ): + stats_processes_instance = StatsProcesses() + stats_processes_instance.add("Test Suite Run", os.getpid()) +- else: +- stats_processes_instance = None ++ session.config.pluginmanager.register(stats_processes_instance, "sysstats-processes") + +- session.config.pluginmanager.register(stats_processes_instance, "sysstats-processes") +- +- terminalreporter = session.config.pluginmanager.getplugin( +- "terminalreporter" +- ) # type: "TerminalReporter" +- sys_stats_reporter = SystemStatsReporter( +- config=session.config, +- stats_processes=stats_processes_instance, +- terminalreporter=terminalreporter, +- ) +- session.config.pluginmanager.register(sys_stats_reporter, "sysstats-reporter") ++ terminalreporter = session.config.pluginmanager.getplugin( ++ "terminalreporter" ++ ) # type: "TerminalReporter" ++ sys_stats_reporter = SystemStatsReporter( ++ config=session.config, ++ stats_processes=stats_processes_instance, ++ terminalreporter=terminalreporter, ++ ) ++ session.config.pluginmanager.register(sys_stats_reporter, "sysstats-reporter") + + + @pytest.fixture(scope="session") # type: ignore[misc] +@@ -252,5 +249,5 @@ def stats_processes(request: "SubRequest") -> StatsProcesses: + """ + Session scoped process statistics tracker. + """ +- plugin = request.config.pluginmanager.get_plugin("sysstats-processes") # type: StatsProcesses +- return plugin ++ if request.config.pluginmanager.has_plugin("sysstats-processes"): ++ return request.config.pluginmanager.get_plugin("sysstats-processes") # type: StatsProcesses |