• <bdo id='81LTV'></bdo><ul id='81LTV'></ul>

      <i id='81LTV'><tr id='81LTV'><dt id='81LTV'><q id='81LTV'><span id='81LTV'><b id='81LTV'><form id='81LTV'><ins id='81LTV'></ins><ul id='81LTV'></ul><sub id='81LTV'></sub></form><legend id='81LTV'></legend><bdo id='81LTV'><pre id='81LTV'><center id='81LTV'></center></pre></bdo></b><th id='81LTV'></th></span></q></dt></tr></i><div id='81LTV'><tfoot id='81LTV'></tfoot><dl id='81LTV'><fieldset id='81LTV'></fieldset></dl></div>
    1. <tfoot id='81LTV'></tfoot>

    2. <legend id='81LTV'><style id='81LTV'><dir id='81LTV'><q id='81LTV'></q></dir></style></legend>
      1. <small id='81LTV'></small><noframes id='81LTV'>

        鼻子框架命令行正则表达式模式匹配不起作用(

        时间:2023-09-10

            <i id='lpr0S'><tr id='lpr0S'><dt id='lpr0S'><q id='lpr0S'><span id='lpr0S'><b id='lpr0S'><form id='lpr0S'><ins id='lpr0S'></ins><ul id='lpr0S'></ul><sub id='lpr0S'></sub></form><legend id='lpr0S'></legend><bdo id='lpr0S'><pre id='lpr0S'><center id='lpr0S'></center></pre></bdo></b><th id='lpr0S'></th></span></q></dt></tr></i><div id='lpr0S'><tfoot id='lpr0S'></tfoot><dl id='lpr0S'><fieldset id='lpr0S'></fieldset></dl></div>

            <tfoot id='lpr0S'></tfoot>

              • <small id='lpr0S'></small><noframes id='lpr0S'>

                <legend id='lpr0S'><style id='lpr0S'><dir id='lpr0S'><q id='lpr0S'></q></dir></style></legend>
                  <tbody id='lpr0S'></tbody>
                  <bdo id='lpr0S'></bdo><ul id='lpr0S'></ul>
                  本文介绍了鼻子框架命令行正则表达式模式匹配不起作用(-e,-m,-i)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  python nosetest 框架有一些命令行选项来包含、排除和匹配正则表达式,用于分别包含/排除和匹配的测试.

                  The python nosetest framework has some command line options to include, exclude and match regex for tests which can be included/excluded and matched respectively.

                  但是它们似乎无法正常工作.

                  However they don't seem to be working correctly.

                  [kiran@my_redhat test]$ nosetests -w cases/ -s -v  -m='_size'
                  ----------------------------------------------------------------------
                  Ran 0 tests in 0.001s
                  OK
                  [kiran@my_redhat test]$ grep '_size' cases/test_case_4.py
                      def test_fn_size_sha(self):
                  

                  鼻子框架的正则表达式匹配语义有什么问题吗?

                  is there some thing wrong with regex matching semantics of nose framework?

                  推荐答案

                  Nosetests' -m 参数用于匹配目录、文件名、类和函数.(查看这个参数的nose docs解释)你的情况,您的测试文件的文件名(test_case_4.py)与-m匹配表达式(_size)不匹配,所以永远不会打开.

                  Nosetests' -m argument is used to match directories, filenames, classes, and functions. (See the nose docs explanation of this parameter) In your case, the filename of your test file (test_case_4.py) does not match the -m match expression (_size), so is never opened.

                  你可能会注意到,如果你强制鼻子打开你的测试文件,它只运行指定的测试:

                  You may notice that if you force nose to open your test file, it will run only the specified test:

                  nosetests -sv -m='_size' cases/test_case_4.py
                  

                  一般来说,当我想匹配特定测试或测试子集时,我会使用 --attrib plugin,在默认的nose安装中可用.您可能还想尝试排除匹配某些模式的测试.

                  In general, when I want to match specific tests or subsets of tests I use the --attrib plugin, which is available in the default nose install. You may also want to try excluding tests that match some pattern.

                  这篇关于鼻子框架命令行正则表达式模式匹配不起作用(-e,-m,-i)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Behave测试框架的测试覆盖工具 下一篇:Python Rope:如何在所有子模块重构中查找所有缺失

                  相关文章

                  最新文章

                  <legend id='Y3IaO'><style id='Y3IaO'><dir id='Y3IaO'><q id='Y3IaO'></q></dir></style></legend>

                • <i id='Y3IaO'><tr id='Y3IaO'><dt id='Y3IaO'><q id='Y3IaO'><span id='Y3IaO'><b id='Y3IaO'><form id='Y3IaO'><ins id='Y3IaO'></ins><ul id='Y3IaO'></ul><sub id='Y3IaO'></sub></form><legend id='Y3IaO'></legend><bdo id='Y3IaO'><pre id='Y3IaO'><center id='Y3IaO'></center></pre></bdo></b><th id='Y3IaO'></th></span></q></dt></tr></i><div id='Y3IaO'><tfoot id='Y3IaO'></tfoot><dl id='Y3IaO'><fieldset id='Y3IaO'></fieldset></dl></div>
                • <tfoot id='Y3IaO'></tfoot>
                    <bdo id='Y3IaO'></bdo><ul id='Y3IaO'></ul>
                • <small id='Y3IaO'></small><noframes id='Y3IaO'>