Open d96ddaf6-a12c-4621-9d6c-b22394020ea3 opened 11 years ago
As part of pyconca sprints, this is my first patch for urlcleanup test
Thanks for your contribution. Can you submit this as a diff?
the patch fie
included issue# in the patch file
It is better to test the side effect of urlcleanup()
only using the public API. There are two side effects:
urlretrieve()
.
It can be tested by checking that the file exists before urlcleanup()
and no longer exists after it.
You should also test that urlcleanup()
is an idempotent operation: if you create the file with the same name name, the repeated call of urlcleanup()
should not delete it.install_opener()
and implicitly by urlopen()
. You can explicitly install a non-standard opener (with a subset of standard handlers, or even with a mock handler), check that urlopen()
only works with the specified handlers, call urlcleanup()
and check that urlopen()
now works with default handlers. And vice versa: test with explicitly non-standard opener after testing with the implicit opener. This may be pretty complicated.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields: ```python assignee = None closed_at = None created_at =
labels = ['type-feature', 'tests']
title = 'test for request.urlretrieve'
updated_at =
user = 'https://bugs.python.org/mjehanzeb'
```
bugs.python.org fields:
```python
activity =
actor = 'wangjiahua'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Tests']
creation =
creator = 'mjehanzeb'
dependencies = []
files = ['31256']
hgrepos = []
issue_num = 18717
keywords = ['patch']
message_count = 4.0
messages = ['194996', '194997', '194999', '195003']
nosy_count = 3.0
nosy_names = ['ezio.melotti', 'mjehanzeb', 'wangjiahua']
pr_nums = ['29822']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue18717'
versions = ['Python 3.4']
```