Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

单元测试缺陷: test_run_testcase_with_abnormal_path 会陷入死循环 #1150

Open
zhengtong0898 opened this issue Jan 15, 2022 · 0 comments
Assignees
Labels
pending pending for confirmation

Comments

@zhengtong0898
Copy link

问题描述

执行单元测试时,遇到了单元测试用例卡住不动的情况.

版本信息

  • 操作系统类型: macos
  • Python 版本: 3.8.2
  • HttpRunner 版本: 3.6.1
  • 设备 ID: 119394988060799

运行命令 && 堆栈信息

main.py

import re
import sys
from httprunner.cli import main


if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])

    sys.argv.append("run")
    sys.argv.append("--showlocals")
    sys.argv.append("tests")
    sys.argv.append("--verbose")
    print(sys.argv)
    main()
$ pwd
/Users/xxxxxxxx/PycharmProjects/httprunner-316

$ python3.8 main.py 
['main.py', 'run', '--showlocals', 'tests/runner_test.py', '--verbose']
2022-01-15 20:14:37.160 | INFO     | httprunner.make:__make:517 - make path: /Users/xxxxxxxx/PycharmProjects/httprunner-316/tests/runner_test.py
2022-01-15 20:14:37.160 | INFO     | httprunner.make:format_pytest_with_black:170 - format pytest cases with black ...
No Path provided. Nothing to do 😴
2022-01-15 20:14:37.331 | INFO     | httprunner.cli:main_run:56 - start to run tests with pytest. HttpRunner version: 3.1.6
============================================================== test session starts ===============================================================
platform darwin -- Python 3.8.12, pytest-5.4.3, py-1.11.0, pluggy-0.13.1 -- /Users/xxxxxxxx/Library/Caches/pypoetry/virtualenvs/py3.8/bin/python3.8
cachedir: .pytest_cache
metadata: {'Python': '3.8.12', 'Platform': 'macOS-10.15.5-x86_64-i386-64bit', 'Packages': {'pytest': '5.4.3', 'py': '1.11.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.9.0', 'html': '2.1.1', 'anyio': '3.3.4'}, 'JAVA_HOME': '/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home'}
rootdir: /Users/xxxxxxxx/PycharmProjects/httprunner-316
plugins: metadata-1.9.0, html-2.1.1, anyio-3.3.4
collected 3 items                                                                                                                                

tests/runner_test.py::TestHttpRunner::test_run_testcase_by_path_ref_testcase PASSED           [ 33%]
tests/runner_test.py::TestHttpRunner::test_run_testcase_by_path_request_only PASSED           [ 66%]
tests/runner_test.py::TestHttpRunner::test_run_testcase_with_abnormal_path                    # 一直僵持在这里
@zhengtong0898 zhengtong0898 added the pending pending for confirmation label Jan 15, 2022
zhengtong0898 added a commit to zhengtong0898/httprunner that referenced this issue Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending pending for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants