From 9339ce78e83c156c292918eecd75ce7243e1b68f Mon Sep 17 00:00:00 2001 From: Dimitri Huisman Date: Fri, 19 Aug 2022 18:57:58 +0000 Subject: [PATCH] Fix datetime usage in test.py --- tests/compose/test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/compose/test.py b/tests/compose/test.py index 50e9b9ad..0b63e522 100755 --- a/tests/compose/test.py +++ b/tests/compose/test.py @@ -2,6 +2,7 @@ import sys import os import time import datetime +from xmlrpc.client import DateTime import docker from colorama import Fore, Style import subprocess @@ -56,7 +57,7 @@ def health_checks(deadline): if exit_code == 0: return True - elif exit_code != 0 and deadline > datetime.now(): + elif exit_code != 0 and deadline > datetime.datetime.now(): stop(exit_code) def print_logs(): @@ -84,7 +85,7 @@ def hooks(): # Start up containers sys.stdout.flush() -deadline=datetime.now()+datetime.timedelta(minutes=timeout) +deadline=datetime.datetime.now()+datetime.timedelta(minutes=timeout) print(subprocess.check_output("docker-compose -f " + compose_file + " up -d", shell=True).decode()) print() print(Fore.LIGHTMAGENTA_EX + "Sleeping for 10s" + Style.RESET_ALL)