test_template.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. """
  2. Day {{DAY_N}}: {{TOPIC_NAME}} - Test Suite
  3. Use pytest to verify your implementation.
  4. Run with: pytest tests/test_day{{DAY_N}}.py -v
  5. Expected assertions:
  6. - Tensor shapes match expectation
  7. - Numerical values within tolerance
  8. - Edge cases handled correctly
  9. """
  10. import pytest
  11. import numpy as np
  12. import torch
  13. from your_module import {{function_name}} # Import your solution here
  14. class TestDay{{DAY_N}}{{TOPIC_NAME}}:
  15. """Test suite for Day {{DAY_N}}: {{TOPIC_NAME}}"""
  16. def test_basic_case(self):
  17. """Test with basic, typical inputs"""
  18. # TODO: Add typical test case
  19. pytest.skip("Pending implementation")
  20. def test_shapes_match(self):
  21. """Verify output tensor shape matches expected"""
  22. # TODO: Add shape assertion
  23. pytest.skip("Pending implementation")
  24. def test_numerical_precision(self):
  25. """Use np.testing.assert_allclose for numerical comparison"""
  26. # TODO: Add precision assertion
  27. pytest.skip("Pending implementation")
  28. def test_edge_case_1(self):
  29. """Test edge case 1"""
  30. pytest.skip("Pending implementation")
  31. def test_edge_case_2(self):
  32. """Test edge case 2"""
  33. pytest.skip("Pending implementation")
  34. class TestVisualizer:
  35. """Test the plot_concept() visualization"""
  36. def test_plot_renders(self):
  37. """Verify the plot function renders without error"""
  38. pytest.skip("Manual visual inspection required")
  39. if __name__ == "__main__":
  40. pytest.main([__file__, "-v"])