<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Yao, before we talk about this challenge, could you answer the
    questions in the other thread you started?  You're building a very
    complex structure here, and I don't understand why.  I think you are
    overcomplicating your system.<br>
    <br>
    --Ned.<br>
    <br>
    <div class="moz-cite-prefix">On 4/3/15 8:37 AM, yaoyansibase wrote:<br>
    </div>
    <blockquote
      cite="mid:abf14589-720b-4f32-8d3e-7e4c3c9f5aee@aliyun.com"
      type="cite">
      <div class="__aliyun_email_body_block">
        <div>Hi all,<br>
          I use python 2.7.3 on windows7 x64. And here is my package
          structure:<br>
          <br>
          project_0001/<br>
            |___plugin_0001/<br>
            |    |___test/<br>
            |    |     |___test_0001/<br>
            |    |     |     |___ __init__.py<br>
            |    |     |     |___ test.py<br>
            |    |     |<br>
            |    |     |___test_0002/<br>
            |    |     |     |___ __init__.py<br>
            |    |     |     |___ test.py<br>
            |    |     |<br>
            |    |     |___test_0003/<br>
            |    |     |     |___ __init__.py<br>
            |    |     |     |___ test.py<br>
            |    |     |<br>
            |    |     |___ __init__.py<br>
            |    |     |___ test.py<br>
            |    |<br>
            |    |_____ __init__.py<br>
            |    |_____ test.py<br>
          <br>
          I can run all these test cases by typing the following
          command:<br>
          cd \project_0001\plugin_0001\test<br>
          python -m unittest discover<br>
          <br>
          Now I'm going to filter out packages test_0002 and test_0003.
          So I add load_tests(...) in
          project_0001\plugin_0001\test\__init__.py, like this:<br>
          def load_tests(loader, standard_tests, pattern):<br>
              # top level directory cached on loader instance<br>
              this_dir = os.path.dirname(__file__)<br>
              package_tests = loader.discover(start_dir=this_dir,
          pattern='test_0001')<br>
              standard_tests.addTests(package_tests)<br>
              return standard_tests<br>
          <br>
          and run the following command:<br>
          cd \project_0001\plugin_0001\test<br>
          python -m unittest discover<br>
          But test_0002 and test_0003 are not filtered out all.<br>
          <br>
          Then I copy project_0001\plugin_0001\test\__init__.py to
          project_0001\plugin_0001\__init__.py, and run the following
          command:<br>
          cd \project_0001\plugin_0001\<br>
          python -m unittest discover<br>
          But test_0002 and test_0003 are not filtered out all too.<br>
          <br>
          <br>
          Is there anything wrong in my steps? how to filter out
          packages test_0002 and test_0003?<br>
          <br>
          Cheers<br>
          yao</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
testing-in-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>
<a class="moz-txt-link-freetext" href="http://lists.idyll.org/listinfo/testing-in-python">http://lists.idyll.org/listinfo/testing-in-python</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>