From 65d3b1084ba22de992e09f2000ee332472152a97 Mon Sep 17 00:00:00 2001 From: salman2013 Date: Tue, 3 Oct 2023 00:11:23 +0500 Subject: [PATCH] chore: fix test cases --- common/djangoapps/terrain/stubs/lti.py | 1 - .../pytest_plugin.py | 27 +++++++++++-------- pavelib/paver_tests/test_js_test.py | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/common/djangoapps/terrain/stubs/lti.py b/common/djangoapps/terrain/stubs/lti.py index 158bf860da..46535abb9f 100644 --- a/common/djangoapps/terrain/stubs/lti.py +++ b/common/djangoapps/terrain/stubs/lti.py @@ -13,7 +13,6 @@ not possible to have this LTI multiple times on a single page in LMS. import base64 import hashlib import logging -import os import textwrap from unittest import mock from uuid import uuid4 diff --git a/openedx/testing/coverage_context_listener/pytest_plugin.py b/openedx/testing/coverage_context_listener/pytest_plugin.py index 28fd90fc6a..6ed194b91b 100644 --- a/openedx/testing/coverage_context_listener/pytest_plugin.py +++ b/openedx/testing/coverage_context_listener/pytest_plugin.py @@ -3,6 +3,9 @@ A pytest plugin that reports test contexts to coverage running in another proces """ import pytest +# import requests + +# from pavelib.utils.envs import Env class RemoteContextPlugin: @@ -13,15 +16,17 @@ class RemoteContextPlugin: self.config = config self.active = config.getoption("pytest-contexts") - @pytest.hookimpl(tryfirst=True) - def pytest_configure(config): - config.pluginmanager.register(RemoteContextPlugin(config), "remotecontextplugin") - def pytest_addoption(parser): - group = parser.getgroup("coverage") - group.addoption( - "--pytest-remote-contexts", - action="store_true", - dest="pytest-contexts", - help="Capture the pytest contexts that coverage is being captured in in another process", - ) +@pytest.hookimpl(tryfirst=True) +def pytest_configure(config): + config.pluginmanager.register(RemoteContextPlugin(config), "remotecontextplugin") + + +def pytest_addoption(parser): + group = parser.getgroup("coverage") + group.addoption( + "--pytest-remote-contexts", + action="store_true", + dest="pytest-contexts", + help="Capture the pytest contexts that coverage is being captured in in another process", + ) diff --git a/pavelib/paver_tests/test_js_test.py b/pavelib/paver_tests/test_js_test.py index c6860e127a..9d89a94444 100644 --- a/pavelib/paver_tests/test_js_test.py +++ b/pavelib/paver_tests/test_js_test.py @@ -127,7 +127,7 @@ class TestPaverJavaScriptTestTasks(PaverTestCase): if suite != 'jest-snapshot': karma_config_file = Env.KARMA_CONFIG_FILES[Env.JS_TEST_ID_KEYS.index(suite)] expected_test_tool_command = command_template.format( - options=self.EXPECTED_KARMA_OPTIONS.format( + options=self.EXPECTED_KARMA_OPTIONS.format( config_file=karma_config_file, single_run='false' if dev_mode else 'true', suite=suite,