mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-26 02:40:05 +08:00
print python 2 retire message as warning
This commit is contained in:
@@ -10,6 +10,7 @@ import random
|
||||
import re
|
||||
import string
|
||||
import types
|
||||
from datetime import datetime
|
||||
|
||||
from httprunner import exception, logger
|
||||
from httprunner.compat import OrderedDict, is_py2, is_py3
|
||||
@@ -457,3 +458,15 @@ def prettify_json_file(file_list):
|
||||
out.write('\n')
|
||||
|
||||
print("success: {}".format(outfile))
|
||||
|
||||
def get_python2_retire_msg():
|
||||
retire_day = datetime(2020, 1, 1)
|
||||
today = datetime.now()
|
||||
left_days = (retire_day - today).days
|
||||
|
||||
if left_days > 0:
|
||||
retire_msg = "Python 2 will retire in {} days, why not move to Python 3?".format(left_days)
|
||||
else:
|
||||
retire_msg = "Python 2 has been retired, you should move to Python 3."
|
||||
|
||||
return retire_msg
|
||||
|
||||
Reference in New Issue
Block a user