From a87652e17f1bfb92ed4d3077e1745be6f463586a Mon Sep 17 00:00:00 2001 From: shanto268 Date: Sun, 17 Nov 2024 17:09:32 -0800 Subject: [PATCH] docs: Fix linting issues to satisfy CI checks --- .../table_view_all_components.py | 5 +++- qiskit_metal/tests/run_all_tests.py | 23 +++++++++---------- qiskit_metal/tests/test_toolbox_metal.py | 2 ++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/qiskit_metal/_gui/widgets/all_components/table_view_all_components.py b/qiskit_metal/_gui/widgets/all_components/table_view_all_components.py index b09820994..bc502e866 100644 --- a/qiskit_metal/_gui/widgets/all_components/table_view_all_components.py +++ b/qiskit_metal/_gui/widgets/all_components/table_view_all_components.py @@ -47,7 +47,10 @@ def __init__(self, parent: QtWidgets.QWidget): parent (QWidget): Parent widget """ QTableView.__init__(self, parent) - QWidget_PlaceholderText.__init__(self, "No QComponents to show.\n\nCreate components from the QLibrary.", self) + QWidget_PlaceholderText.__init__( + self, + "No QComponents to show.\n\nCreate components from the QLibrary.", + self) # Connect signals self.clicked.connect(self.viewClicked) diff --git a/qiskit_metal/tests/run_all_tests.py b/qiskit_metal/tests/run_all_tests.py index 29db43701..698d92411 100644 --- a/qiskit_metal/tests/run_all_tests.py +++ b/qiskit_metal/tests/run_all_tests.py @@ -24,34 +24,33 @@ ERRORS_EXIST = 0 # Open log files - with open("test_results.log", "w") as results_log, open("test_errors.log", "w") as errors_log: + with open("test_results.log", + "w") as results_log, open("test_errors.log", "w") as errors_log: for entry in LIST_OF_FILES: if fnmatch.fnmatch(entry, PATTERN): if entry != sys.argv[0]: print(f"Running {entry} tests...") results_log.write(f"Running {entry} tests...\n") - + # Run the test and capture output - result = subprocess.run( - f"python {entry}", - shell=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - text=True - ) - + result = subprocess.run(f"python {entry}", + shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True) + # Write the stdout and stderr to test_results.log results_log.write(result.stdout) results_log.write(result.stderr) results_log.write("\n") - + # If there's an error, write it to test_errors.log if result.returncode != 0: ERRORS_EXIST += 1 errors_log.write(f"Error in {entry}:\n") errors_log.write(result.stderr) errors_log.write("\n") - + print("") print("All tests complete") diff --git a/qiskit_metal/tests/test_toolbox_metal.py b/qiskit_metal/tests/test_toolbox_metal.py index 2c2218762..8ff387a92 100644 --- a/qiskit_metal/tests/test_toolbox_metal.py +++ b/qiskit_metal/tests/test_toolbox_metal.py @@ -41,6 +41,8 @@ from qiskit_metal.toolbox_metal.layer_stack_handler import LayerStackHandler TEST_DATA = Path(__file__).parent / "test_data" + + class TestToolboxMetal(unittest.TestCase, AssertionsMixin): """Unit test class."""