Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Toblerity/Fiona
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Gillies committed Oct 26, 2018
2 parents 530dfeb + 58a6b64 commit afce5e6
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 261 deletions.
4 changes: 2 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
For example:
$ git grep 'from \.' | grep test
tests/test_layer.py:from .test_collection import ReadingTest
tests/test_vfs.py:from .test_collection import ReadingTest
tests/test_layer.py:from .test_collection import TestReading
tests/test_vfs.py:from .test_collection import TestReading
"""
29 changes: 12 additions & 17 deletions tests/test_bytescollection.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
"""Tests for ``fiona.BytesCollection()``."""


import unittest

import pytest
import six

import fiona

@pytest.mark.usefixtures('uttc_path_coutwildrnp_json')
class ReadingTest(unittest.TestCase):

def setUp(self):
with open(self.path_coutwildrnp_json) as src:
class TestReading(object):
@pytest.fixture(autouse=True)
def bytes_collection_object(self, path_coutwildrnp_json):
with open(path_coutwildrnp_json) as src:
bytesbuf = src.read().encode('utf-8')
self.c = fiona.BytesCollection(bytesbuf)

def tearDown(self):
yield
self.c.close()

@pytest.mark.skipif(six.PY2, reason='string are bytes in Python 2')
def test_construct_with_str(self):
with open(self.path_coutwildrnp_json) as src:
def test_construct_with_str(self, path_coutwildrnp_json):
with open(path_coutwildrnp_json) as src:
strbuf = src.read()
with pytest.raises(ValueError):
fiona.BytesCollection(strbuf)
Expand Down Expand Up @@ -176,15 +173,13 @@ def test_in_keys(self):
assert 0 in self.c


@pytest.mark.usefixtures('uttc_path_coutwildrnp_json')
class FilterReadingTest(unittest.TestCase):

def setUp(self):
with open(self.path_coutwildrnp_json) as src:
class TestFilterReading(object):
@pytest.fixture(autouse=True)
def bytes_collection_object(self, path_coutwildrnp_json):
with open(path_coutwildrnp_json) as src:
bytesbuf = src.read().encode('utf-8')
self.c = fiona.BytesCollection(bytesbuf)

def tearDown(self):
yield
self.c.close()

def test_filter_1(self):
Expand Down

0 comments on commit afce5e6

Please sign in to comment.