From c771b5adc870f4cf453ccc64c87edfb8c3b6d869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=A6=E5=BD=92=E4=BA=91=E5=B8=86?= <1138663075@qq.com> Date: Sun, 7 Jul 2024 15:16:28 +0800 Subject: [PATCH] add test kit --- .github/workflows/pypi.yml | 2 +- .github/workflows/wheels.yml | 2 +- .gitignore | 3 ++- README.md | 9 ++++++++- src/pylibde265/version.py | 2 -- test/cover.py | 10 ++++++++++ test/test_fun.py | 8 ++++++++ test/tester.py | 7 +++++++ tools_upload_test.py => tools_upload_testpypi.py | 0 9 files changed, 37 insertions(+), 6 deletions(-) delete mode 100644 src/pylibde265/version.py create mode 100644 test/cover.py create mode 100644 test/test_fun.py create mode 100644 test/tester.py rename tools_upload_test.py => tools_upload_testpypi.py (100%) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 794c1d2..5f6fcbb 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [windows-latest] # Optional: build on multiple platforms steps: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 925a218..586b6d2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,7 +8,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index ba0909f..85606e7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ __pycache__/ dist/ *.egg-info trashcan/ -*.whl \ No newline at end of file +*.whl +.coverage \ No newline at end of file diff --git a/README.md b/README.md index 92e2447..6d8196c 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ downloads:all downloads:latest_verson downloads-dm:pypi + version:pypi count:file/dir count:size @@ -70,7 +71,6 @@ with open(vedio_path,'rb') as data: 代码解释: - # 深入了解 * 在线文档(待建) @@ -130,6 +130,13 @@ scipy >= 1.14.0 numpy >= 2.0.0 ``` +环境需求-测试 + +``` +coverage >= 7.5.4 +pytest >= 8.2.2 +``` + # 常见问题 | 问题Q | 回答A | 日期 | 版本 | diff --git a/src/pylibde265/version.py b/src/pylibde265/version.py deleted file mode 100644 index be0904c..0000000 --- a/src/pylibde265/version.py +++ /dev/null @@ -1,2 +0,0 @@ - -Pack_version= b'0.0.0' \ No newline at end of file diff --git a/test/cover.py b/test/cover.py new file mode 100644 index 0000000..6d16d34 --- /dev/null +++ b/test/cover.py @@ -0,0 +1,10 @@ +import os + +if __name__ == "__main__": + command = 'coverage run -m pytest' + + os.system(command=command) + + command = 'coverage report -m' + + os.system(command=command) \ No newline at end of file diff --git a/test/test_fun.py b/test/test_fun.py new file mode 100644 index 0000000..d0771bd --- /dev/null +++ b/test/test_fun.py @@ -0,0 +1,8 @@ +import pylibde265.pyde265 + +def test_version(): + assert pylibde265.pyde265.get_version() + +def test_decode(): + pass + diff --git a/test/tester.py b/test/tester.py new file mode 100644 index 0000000..197b8da --- /dev/null +++ b/test/tester.py @@ -0,0 +1,7 @@ +import os + + +if __name__ == "__main__": + command = 'pytest' + + os.system(command=command) \ No newline at end of file diff --git a/tools_upload_test.py b/tools_upload_testpypi.py similarity index 100% rename from tools_upload_test.py rename to tools_upload_testpypi.py