[issue24855] fail to mock the urlopen function

2015-08-16 Thread sih4sing5hong5
sih4sing5hong5 added the comment: I moved the import urlopen inside the patch. The mock worked. Thank you for explanations. I understand now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24855

[issue24855] fail to mock the urlopen function

2015-08-13 Thread sih4sing5hong5
New submission from sih4sing5hong5: I also posted in stackoverflow: http://stackoverflow.com/questions/30978207/python-urlopen-mock-fail ``` from unittest.mock import patch import urllib from urllib import request from urllib.request import urlopen @patch('urllib.request.urlopen') def

[issue24855] fail to mock the urlopen function

2015-08-13 Thread sih4sing5hong5
sih4sing5hong5 added the comment: It is normal because of __all__ syntax. By: https://github.com/testing-cabal/mock/issues/313#issuecomment-130564364 -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue24263] unittest cannot load module whose name starts with Unicode

2015-06-23 Thread sih4sing5hong5
sih4sing5hong5 added the comment: Thank you. I updated my patch in `VALID_MODULE_NAME.patch`. -- Added file: http://bugs.python.org/file39789/VALID_MODULE_NAME.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24263

[issue24263] unittest cannot load module whose name starts with Unicode

2015-06-23 Thread sih4sing5hong5
Changes by sih4sing5hong5 ihc...@gmail.com: Removed file: http://bugs.python.org/file39778/VALID_MODULE_NAME.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24263

[issue24263] unittest cannot load module whose name starts with Unicode

2015-06-23 Thread sih4sing5hong5
sih4sing5hong5 added the comment: update by adding `except AttributeError:` -- Added file: http://bugs.python.org/file39794/VALID_MODULE_NAME2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24263

[issue24263] unittest cannot load module whose name starts with Unicode

2015-06-22 Thread sih4sing5hong5
New submission from sih4sing5hong5: Because VALID_MODULE_NAME is r'[_a-z]\w*\.py$' in unittest/loader.py. Using r'[^\W\d]\w*\.py$' insteaded. -- keywords: +patch title: Why VALID_MODULE_NAME in unittest/loader.py is r'[_a-z]\w*\.py$' not r'\w+\.py$' ? - unittest cannot load module

[issue24263] unittest cannot load module whose name starts with Unicode

2015-06-22 Thread sih4sing5hong5
sih4sing5hong5 added the comment: There is an attached file for examples. I ran {{{ cd test_dir python -m unittest -v }}} and got Ran 1 test in 0.000s -- Added file: http://bugs.python.org/file39779/test_dir.tar.gz ___ Python tracker rep

[issue24263] unittest cannot load module whose name starts with Unicode

2015-06-22 Thread sih4sing5hong5
sih4sing5hong5 added the comment: By the way, I ran with Python 3.4.0. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24263 ___ ___ Python-bugs

[issue24263] Why VALID_MODULE_NAME in unittest/loader.py is r'[_a-z]\w*\.py$' not r'\w+\.py$' ?

2015-05-22 Thread sih4sing5hong5
Changes by sih4sing5hong5 ihc...@gmail.com: -- components: Unicode nosy: ezio.melotti, haypo, sih4sing5hong5 priority: normal severity: normal status: open title: Why VALID_MODULE_NAME in unittest/loader.py is r'[_a-z]\w*\.py$' not r'\w+\.py$' ? type: behavior versions: Python 3.2