用于为mypy插件编写测试的pytest插件

pytest-mypy-plugins的Python项目详细描述


mypy logo

用于测试mypy自定义插件的pytest插件

Build StatusChecked with mypy

测试用例示例:

-   case: request_object_has_user_of_type_auth_user_model
    disable_cache: true
    main: |
        from django.http.request import HttpRequest
        reveal_type(HttpRequest().user)  # N: Revealed type is 'myapp.models.MyUser'
        # check that other fields work ok
        reveal_type(HttpRequest().method)  # N: Revealed type is 'Union[builtins.str, None]'
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models
                class MyUser(models.Model):
                    pass

选项:

mypy-tests:
  --mypy-testing-base=MYPY_TESTING_BASE
                        Base directory for tests to use
  --mypy-ini-file=MYPY_INI_FILE
                        Which .ini file to use as a default config for tests
  --mypy-same-process 
                        Now, to help with various issues in django-stubs, it runs every single test in the subprocess mypy call. 
                        Some debuggers cannot attach to subprocess, so enable this flag to make mypy check happen in the same process.
                        (Could cause cache issues)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何表示1。。Java中的n关系   java在安卓应用程序中添加polaris viewer   Java字符串::replaceAll仅替换第一个出现(可能不正确的正则表达式)   java Tomcat/JBoss部署后脚本   如何在Heroku Java应用程序中运行发出web请求的周期进程   java如何以纳秒为单位证明算法的时间   Solaris上的java自定义ListCellRenderer(使用jre5)   java试图为我的播放器类测试块实现播放器重力(RealtutsGml平台教程)   c#消耗一个。带有java的net web服务未显示预期结果   java在KOI8\R中检索html   基于java图形的搜索与基于随机的搜索   java如何检查安卓设备上的可用空间?在SD卡上?