/
Denis57Python
/
Py_Calculator
Обзор
Документация
Войти
/
Denis57Python
/
Py_Calculator
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
tests/test_memory_gui.py
26 строк
905 B
Denis57Python
Загрузить файлы в «»
15 апр 2026, 19:01
Верифицирован
15 апр 2026, 19:01
40f9470
Код
Авторство
О чём код?
from memory_profiler import profile from calculate_discount.calc import calculate_discount import subprocess import sys @profile def test_memory_gui(): # Замер памяти при запуске приложения subprocess.Popen([sys.executable, "main.py"]) input("Нажмите Enter после закрытия окна приложения...") @profile def test_memory_calculation(): # Замер памяти при массовых вычислениях results = [] for i in range(5000): result = calculate_discount(i*10.0, (i%100)) results.append(result) return results if __name__ == "__main__": print("Тест 1: Замер памяти приложения") test_memory_gui() print("Тест 2: Замер памяти вычислений") results = test_memory_calculation() del results