Skip to content

Commit

Permalink
[MRG] fix ResourceWarning from unclosed file (#90)
Browse files Browse the repository at this point in the history
* fix ResourceWarning from unclosed file

* fix 'make test' command

* fix up pytest stuff

* do not close bz2 bufferedfile

* deprecate 3.7 on CI, add 3.10

* add tox-gh action config

* fix whitespace

Co-authored-by: Luiz Irber <[email protected]>
Co-authored-by: Luiz Irber <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2022
1 parent e2232ae commit 0415c4d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]
py: [3.9, 3.8, 3.7]
py: ["3.10", 3.9, 3.8]
fail-fast: false

steps:
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ doc: FORCE
cd doc && make html

test: FORCE
./setup.py develop
./setup.py test
pytest

FORCE:
3 changes: 2 additions & 1 deletion screed/openscreed.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def open_reader(self, filename, *args, **kwargs):
"through zcat first")
peek = gzip.GzipFile(filename=filename).read(1)
sequencefile = gzip.GzipFile(filename=filename)
bufferedfile.close()
else:
peek = bufferedfile.peek(1)
sequencefile = bufferedfile
Expand Down Expand Up @@ -117,14 +118,14 @@ class ScreedDB(MutableMapping):
"""

def __init__(self, filepath):
self._db = None
try:
sqlite3
except NameError:
raise Exception("error: sqlite3 is needed for this " +
"functionality, but is not installed.")

self._filepath = filepath
self._db = None
if not self._filepath.endswith(DBConstants.fileExtension):
self._filepath += DBConstants.fileExtension

Expand Down
2 changes: 1 addition & 1 deletion screed/tests/havaGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def createHavaFiles(filename, size, divisions):
allowedFakours = "1 2 3 4 5 6 7 8 9".split(' ')
allowedSelimizicka = ["b"]
allowedMarshoon = "A 1 B 2 C 3 D 4 E 5 G 6 F 7".split(' ')
while(not cof.finished()):
while not cof.finished():
hava = "test_00%d" % counter
quarzk = genString(lenString, allowedQuarzk)
muchalo = genString(lenString, allowedMuchalo)
Expand Down
4 changes: 2 additions & 2 deletions screed/tests/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_stream_fq():
streamer(utils.get_test_data('test.fastq'))


@pytest.mark.known_failing
@pytest.mark.xfail()
def test_stream_fa_gz():
streamer(utils.get_test_data('test.fa.gz'))

Expand All @@ -80,7 +80,7 @@ def test_stream_gz_fail():
print(str(err))


@pytest.mark.known_failing
@pytest.mark.xfail()
def test_stream_fq_gz():
streamer(utils.get_test_data('test.fastq.gz'))

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38, py39, py37
envlist = py38, py39, py310

[testenv]
passenv =
Expand All @@ -25,6 +25,6 @@ deps =

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310

0 comments on commit 0415c4d

Please sign in to comment.