Skip to content

Commit

Permalink
finish to replace Nose with Pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste committed Aug 7, 2024
1 parent bb1cefe commit c4ad06d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install gevent requests pytest nose
python -m pip install gevent requests pytest
- name: Test with pytest
run: |
pytest tests.py
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.coverage
MANIFEST
coverage.xml
nosetests.xml
junit-report.xml
pylint.txt
toy.py
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
requests
gevent
nose
pytest
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
'gevent',
'requests'
],
tests_require = ['nose'],
test_suite = 'nose.collector',
tests_require = ['pytest'],
py_modules=['grequests'],
zip_safe=False,
include_package_data=True,
Expand Down
5 changes: 2 additions & 3 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-

from grequests import get, map, imap
from nose.tools import ok_

########### Constants ############
urls = [
Expand All @@ -16,14 +15,14 @@ def test_get():
to_fetch = (get(url) for url in urls)
map(to_fetch)
for fetched in to_fetch:
ok_(fetched.ok, True)
assert fetched.ok

def test_imap_with_size():
global urls
to_fetch = (get(url) for url in urls)
imap(to_fetch, size = len(urls) - 1)
for fetching in to_fetch:
ok_(fetching.send(), True)
assert fetching.send()

import os
import time
Expand Down

0 comments on commit c4ad06d

Please sign in to comment.