Skip to content

Commit 0415c4d

Browse files
ctbluizirber
andauthoredDec 3, 2022
[MRG] fix ResourceWarning from unclosed file (#90)
* 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]>
1 parent e2232ae commit 0415c4d

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed
 

‎.github/workflows/python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-18.04, macos-latest]
17-
py: [3.9, 3.8, 3.7]
17+
py: ["3.10", 3.9, 3.8]
1818
fail-fast: false
1919

2020
steps:

‎Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ doc: FORCE
4343
cd doc && make html
4444

4545
test: FORCE
46-
./setup.py develop
47-
./setup.py test
46+
pytest
4847

4948
FORCE:

‎screed/openscreed.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def open_reader(self, filename, *args, **kwargs):
6767
"through zcat first")
6868
peek = gzip.GzipFile(filename=filename).read(1)
6969
sequencefile = gzip.GzipFile(filename=filename)
70+
bufferedfile.close()
7071
else:
7172
peek = bufferedfile.peek(1)
7273
sequencefile = bufferedfile
@@ -117,14 +118,14 @@ class ScreedDB(MutableMapping):
117118
"""
118119

119120
def __init__(self, filepath):
121+
self._db = None
120122
try:
121123
sqlite3
122124
except NameError:
123125
raise Exception("error: sqlite3 is needed for this " +
124126
"functionality, but is not installed.")
125127

126128
self._filepath = filepath
127-
self._db = None
128129
if not self._filepath.endswith(DBConstants.fileExtension):
129130
self._filepath += DBConstants.fileExtension
130131

‎screed/tests/havaGen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def createHavaFiles(filename, size, divisions):
7878
allowedFakours = "1 2 3 4 5 6 7 8 9".split(' ')
7979
allowedSelimizicka = ["b"]
8080
allowedMarshoon = "A 1 B 2 C 3 D 4 E 5 G 6 F 7".split(' ')
81-
while(not cof.finished()):
81+
while not cof.finished():
8282
hava = "test_00%d" % counter
8383
quarzk = genString(lenString, allowedQuarzk)
8484
muchalo = genString(lenString, allowedMuchalo)

‎screed/tests/test_streaming.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_stream_fq():
6767
streamer(utils.get_test_data('test.fastq'))
6868

6969

70-
@pytest.mark.known_failing
70+
@pytest.mark.xfail()
7171
def test_stream_fa_gz():
7272
streamer(utils.get_test_data('test.fa.gz'))
7373

@@ -80,7 +80,7 @@ def test_stream_gz_fail():
8080
print(str(err))
8181

8282

83-
@pytest.mark.known_failing
83+
@pytest.mark.xfail()
8484
def test_stream_fq_gz():
8585
streamer(utils.get_test_data('test.fastq.gz'))
8686

‎tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py38, py39, py37
2+
envlist = py38, py39, py310
33

44
[testenv]
55
passenv =
@@ -25,6 +25,6 @@ deps =
2525

2626
[gh-actions]
2727
python =
28-
3.7: py37
2928
3.8: py38
3029
3.9: py39
30+
3.10: py310

0 commit comments

Comments
 (0)
Please sign in to comment.