From 998fee147127f9c5bdf0bdc30523d96a4fff2ffd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 19:47:35 +0000 Subject: [PATCH 1/4] Initial plan From 5644bd2215c9f95c3090cedfa1ce2d7766a3ff51 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 19:52:53 +0000 Subject: [PATCH 2/4] Fix import error in __init__.py by adding fallback import Co-authored-by: willtheorangeguy <18339050+willtheorangeguy@users.noreply.github.com> --- __init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 97d8b50..1e6f06a 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,9 @@ """Initialize PyPI Package""" # pylint: disable=invalid-name, import-error -from main import workout +try: + from main import workout +except ImportError: + from .main import workout __all__ = ["workout"] From e9dc16e3d59b2dac3dfa2274256cd0c0039d4185 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 19:53:05 +0000 Subject: [PATCH 3/4] style: format code with Black This commit fixes the style issues introduced in 5644bd2 according to the output from Black. Details: https://github.com/Dog-Face-Development/PyWorkout/pull/182 --- __init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/__init__.py b/__init__.py index 1e6f06a..9cd7da2 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,5 @@ """Initialize PyPI Package""" + # pylint: disable=invalid-name, import-error try: From 76a89cf30c3cea799acd3c4a00548a2cf56ba0e9 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 19 Nov 2025 12:58:02 -0700 Subject: [PATCH 4/4] Delete tests/test_gui.py --- tests/test_gui.py | 96 ----------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 tests/test_gui.py diff --git a/tests/test_gui.py b/tests/test_gui.py deleted file mode 100644 index 5485069..0000000 --- a/tests/test_gui.py +++ /dev/null @@ -1,96 +0,0 @@ -""" -Test suite for PyWorkout GUI module. -Tests the GUI components and functionality. -""" - -import sys -import os -from unittest.mock import patch, MagicMock -import pytest - -# Add parent directory to path for imports -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - - -class TestGUIImports: - """Test that GUI module can be imported and has necessary components.""" - - def test_gui_module_exists(self): - """Test that gui module can be imported.""" - try: - import gui - - assert True - except ImportError as e: - pytest.skip( - f"GUI module import failed (expected if tkinter not available): {e}" - ) - - def test_gui_has_tkinter_components(self): - """Test that GUI has tkinter components if available.""" - try: - import gui - - # Check if basic GUI components are defined - assert ( - hasattr(gui, "window") or True - ) # GUI might not initialize in headless environment - except ImportError: - pytest.skip("GUI module not available") - - -class TestPercentageFunction: - """Test the percentage calculation function.""" - - def test_percentages_function_exists(self): - """Test that percentages function exists in GUI module.""" - try: - import gui - - assert hasattr(gui, "percentages") - except ImportError: - pytest.skip("GUI module not available") - - def test_percentages_calculation(self): - """Test percentage calculation for different locations.""" - try: - import gui - - # Test first position - result = gui.percentages(0) - assert result == "8" - - # Test middle position - result = gui.percentages(5) - assert result == "50" - - # Test last position - result = gui.percentages(11) - assert result == "100" - - except ImportError: - pytest.skip("GUI module not available") - except Exception as e: - pytest.skip(f"GUI test skipped due to: {e}") - - -class TestGUIComponents: - """Test GUI window and component initialization.""" - - def test_window_title(self): - """Test that window has correct title.""" - try: - import gui - - if hasattr(gui, "window"): - # In headless environment, this might not work - # but we can check the module was imported - assert True - except ImportError: - pytest.skip("GUI module not available") - except Exception as e: - pytest.skip(f"GUI test skipped in headless environment: {e}") - - -if __name__ == "__main__": - pytest.main([__file__, "-v"])