Skip to content

Commit

Permalink
remove the unnecessary test for runner
Browse files Browse the repository at this point in the history
  • Loading branch information
ibro45 committed Jan 31, 2025
1 parent d0f7399 commit 6abba8a
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions tests/unit/test_engine_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,30 +259,3 @@ def test_cli_fire_interface(mock_fire):
"lr_find",
"scale_batch_size",
}


def test_main_guard():
"""Test the __main__ guard."""
with patch("lighter.engine.runner.cli") as mock_cli:
# Execute the main module
exec(
compile(
'if __name__ == "__main__": cli()',
filename="lighter/engine/runner.py",
mode="exec",
),
{"__name__": "__main__", "cli": mock_cli},
)
mock_cli.assert_called_once()

# Reset mock and test when not main
mock_cli.reset_mock()
exec(
compile(
'if __name__ == "__main__": cli()',
filename="lighter/engine/runner.py",
mode="exec",
),
{"__name__": "not_main", "cli": mock_cli},
)
mock_cli.assert_not_called()

0 comments on commit 6abba8a

Please sign in to comment.