Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finish to replace Nose with Pytest #178

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading