| 1 | # file scalene/scalene_profiler.py:313-316 |
| 2 | # lines [313, 314, 316] |
| 3 | # branches [] |
| 4 | |
| 5 | import pytest |
| 6 | import scalene.scalene_config |
| 7 | from scalene.scalene_profiler import Scalene |
| 8 | |
| 9 | |
| 10 | @pytest.fixture(autouse=True) |
| 11 | def run_around_tests(): |
| 12 | # Setup: Store original value |
| 13 | original_trigger_length = scalene.scalene_config.NEWLINE_TRIGGER_LENGTH |
| 14 | # Give a new value for the test |
| 15 | scalene.scalene_config.NEWLINE_TRIGGER_LENGTH = 1 |
| 16 | yield |
| 17 | # Teardown: Restore original value |
| 18 | scalene.scalene_config.NEWLINE_TRIGGER_LENGTH = original_trigger_length |
| 19 | |
| 20 | |
| 21 | def test_update_line(): |
| 22 | # Call the method to test |
| 23 | Scalene.update_line() |
| 24 | # No direct postconditions to assert; the function's purpose is to trigger memory allocation |
| 25 | # We can only assert that no exception was raised |
| 26 | assert True |