sih4sing5hong5 added the comment:
I moved the import urlopen inside the patch.
The mock worked.
Thank you for explanations. I understand now.
--
___
Python tracker
<http://bugs.python.org/issue24
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
<http://bugs.python.org/issu
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&
sih4sing5hong5 added the comment:
update by adding `except AttributeError:`
--
Added file: http://bugs.python.org/file39794/VALID_MODULE_NAME2.patch
___
Python tracker
<http://bugs.python.org/issue24
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
<http://bugs.python.org/issue24
Changes by sih4sing5hong5 :
Removed file: http://bugs.python.org/file39778/VALID_MODULE_NAME.patch
___
Python tracker
<http://bugs.python.org/issue24263>
___
___
Pytho
sih4sing5hong5 added the comment:
By the way, I ran with Python 3.4.0.
--
___
Python tracker
<http://bugs.python.org/issue24263>
___
___
Python-bugs-list mailin
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 trac
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
Changes by sih4sing5hong5 :
--
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
10 matches
Mail list logo