mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 17:29:34 +08:00
change: remove support for Python 2.7
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
**Changed**
|
**Changed**
|
||||||
|
|
||||||
- replace logging with [loguru](https://github.com/Delgan/loguru)
|
- replace logging with [loguru](https://github.com/Delgan/loguru)
|
||||||
|
- remove support for Python 2.7
|
||||||
|
|
||||||
## 2.5.7 (2020-02-21)
|
## 2.5.7 (2020-02-21)
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ import sentry_sdk
|
|||||||
|
|
||||||
from httprunner import __description__, __version__, exceptions
|
from httprunner import __description__, __version__, exceptions
|
||||||
from httprunner.api import HttpRunner
|
from httprunner.api import HttpRunner
|
||||||
from httprunner.compat import is_py2
|
|
||||||
from httprunner.loader import load_cases
|
from httprunner.loader import load_cases
|
||||||
from httprunner.logger import color_print, log_error
|
from httprunner.logger import color_print, log_error
|
||||||
from httprunner.report import gen_html_report
|
from httprunner.report import gen_html_report
|
||||||
from httprunner.utils import (create_scaffold, get_python2_retire_msg,
|
from httprunner.utils import (create_scaffold,
|
||||||
prettify_json_file, init_sentry_sdk)
|
prettify_json_file, init_sentry_sdk)
|
||||||
|
|
||||||
init_sentry_sdk()
|
init_sentry_sdk()
|
||||||
@@ -19,9 +18,6 @@ init_sentry_sdk()
|
|||||||
def main():
|
def main():
|
||||||
""" API test: parse command line options and run commands.
|
""" API test: parse command line options and run commands.
|
||||||
"""
|
"""
|
||||||
if is_py2:
|
|
||||||
color_print(get_python2_retire_msg(), "YELLOW")
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description=__description__)
|
parser = argparse.ArgumentParser(description=__description__)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-V', '--version', dest='version', action='store_true',
|
'-V', '--version', dest='version', action='store_true',
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import json
|
|||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
@@ -654,16 +653,3 @@ def dump_logs(json_data, project_mapping, tag_name):
|
|||||||
"""
|
"""
|
||||||
json_file_abs_path = prepare_dump_json_file_abs_path(project_mapping, tag_name)
|
json_file_abs_path = prepare_dump_json_file_abs_path(project_mapping, tag_name)
|
||||||
dump_json_file(json_data, json_file_abs_path)
|
dump_json_file(json_data, json_file_abs_path)
|
||||||
|
|
||||||
|
|
||||||
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