Skip to content

Commit

Permalink
py3 port: testfile as text, add built-in as example w/o __iter__
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-easterly committed Jun 29, 2018
1 parent 2b55e3a commit d7bbf79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/unit/datatypes/dataproviders/test_base_dataproviders.py
Expand Up @@ -98,8 +98,9 @@ def test_validate_source(self):
"""
def non_iterator_dprov(source):
return self.provider_class(source)
# two objects without __iter__ method: build in function and int
self.assertRaises(exceptions.InvalidDataProviderSource,
non_iterator_dprov, 'one two three')
non_iterator_dprov, sum)
self.assertRaises(exceptions.InvalidDataProviderSource,
non_iterator_dprov, 40)

Expand Down
2 changes: 1 addition & 1 deletion test/unit/unittest_utils/tempfilecache.py
Expand Up @@ -28,7 +28,7 @@ def create_tmpfile(self, contents):

if contents not in self._content_dict:
# create a named tmp and write contents to it, return filename
tmpfile = tempfile.NamedTemporaryFile(delete=False)
tmpfile = tempfile.NamedTemporaryFile(delete=False, mode='w+')
tmpfile.write(contents)
tmpfile.close()
log.debug('created tmpfile.name: %s', tmpfile.name)
Expand Down

0 comments on commit d7bbf79

Please sign in to comment.