1 Star 0 Fork 0

王阿非/OSGeo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

GDAL test suite

How to run tests

  1. You need to install pytest to run the test suite. This should do it:
cd autotest
pip install -r ./requirements.txt
  1. Then, run tests with:
pytest
  1. Some quick usage tips:
# get more verbose output; don't capture stdout/stdin
pytest -vvs

# run all the gcore tests
pytest gcore/

# run a particular module only
pytest gcore/basic_test.py

# run a particular test case in a module
pytest gcore/basic_test.py::test_basic_test_1

Full documentation of pytest at https://docs.pytest.org/en/latest/

GDAL's tests are not independent

GDAL's test functions are not currently independent of each other. In particular, running individual test functions from a given module may not work. Most tests were originally written with the assumption that entire modules will be run at once.

Practically, this means that you should avoid using:

  • pytest's --last-failed / --lf option (since it runs only failed tests, not the whole module)
  • test specifiers that run individual tests (e.g. pytest gcore/basic_test.py::test_basic_test_1 )
  • the xunit plugin to run tests in parallel, unless you also use --dist=loadfile. (This may have other issues; untested)

This will hopefully be addressed in the future. When writing new tests, please try to make them independent of each other.

Notes about availability of GDAL sample and test data

The GDAL Team makes every effort to assure that all sample data files available from GDAL download server (http://download.osgeo.org/gdal/data/) and test data files used in GDAL Autotest package (https://github.com/OSGeo/gdal/tree/master/autotest) are available as public and freely redistributable geodata.

--

http://gdal.org/

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/wangafei/OSGeo.git
git@gitee.com:wangafei/OSGeo.git
wangafei
OSGeo
OSGeo
master

搜索帮助