Skip to content

Commit 60f70e9

Browse files
authored
Merge pull request #178 from a-detiste/master
finish to replace Nose with Pytest
2 parents bb1cefe + c4ad06d commit 60f70e9

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install dependencies
1515
run: |
1616
python -m pip install --upgrade pip
17-
python -m pip install gevent requests pytest nose
17+
python -m pip install gevent requests pytest
1818
- name: Test with pytest
1919
run: |
2020
pytest tests.py

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.coverage
22
MANIFEST
33
coverage.xml
4-
nosetests.xml
54
junit-report.xml
65
pylint.txt
76
toy.py

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
requests
22
gevent
3-
nose
3+
pytest

setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
'gevent',
4545
'requests'
4646
],
47-
tests_require = ['nose'],
48-
test_suite = 'nose.collector',
47+
tests_require = ['pytest'],
4948
py_modules=['grequests'],
5049
zip_safe=False,
5150
include_package_data=True,

tests.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# -*- coding: utf-8 -*-
33

44
from grequests import get, map, imap
5-
from nose.tools import ok_
65

76
########### Constants ############
87
urls = [
@@ -16,14 +15,14 @@ def test_get():
1615
to_fetch = (get(url) for url in urls)
1716
map(to_fetch)
1817
for fetched in to_fetch:
19-
ok_(fetched.ok, True)
18+
assert fetched.ok
2019

2120
def test_imap_with_size():
2221
global urls
2322
to_fetch = (get(url) for url in urls)
2423
imap(to_fetch, size = len(urls) - 1)
2524
for fetching in to_fetch:
26-
ok_(fetching.send(), True)
25+
assert fetching.send()
2726

2827
import os
2928
import time

0 commit comments

Comments
 (0)