Skip to content

Commit

Permalink
Remove nose usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Sep 28, 2021
1 parent b058c5a commit b4c06a4
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
pip install .[dev,test]
- name: Run tests
run: |
python setup.py nosetests
coverage run -m unittest discover tests
- name: Send coverage to Coveralls
continue-on-error: true
env:
Expand Down
7 changes: 4 additions & 3 deletions docs/running_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ These steps outline how to run tests for Tweepy:
``pip install .[test]``. Optionally install the ``dev`` extra as well, for
``tox`` and ``coverage``, e.g. ``pip install .[dev,test]``.

3. Run ``python setup.py nosetests`` or simply ``nosetests`` in the source
directory. With the ``dev`` extra, coverage will be shown, and ``tox`` can
also be run to test different Python versions.
3. Run tests (e.g. ``python -m unittest discover tests``) in the source
directory. With the ``dev`` extra, coverage can be measured by using
``coverage run`` (e.g. ``coverage run -m unittest discover tests``) and
``tox`` can be run to test different Python versions.

To record new cassettes, the following environment variables can be used:

Expand Down
5 changes: 0 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
[bdist_wheel]
universal = 1

[nosetests]
tests = tests.test_api,tests.test_client,tests.test_cursors,tests.test_resultset,tests.test_utils
verbosity = 2
with-coverage = 1
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
long_description = readme_file.read()

tests_require = [
"nose>=1.3.3",
"vcrpy>=1.10.3",
]

Expand Down Expand Up @@ -55,7 +54,7 @@
"socks": ["requests[socks]>=2.11.1,<3"],
"test": tests_require,
},
test_suite="nose.collector",
test_suite="tests",
keywords="twitter library",
python_requires=">=3.6",
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
from ast import literal_eval

from .config import tape, TweepyTestCase, username
from tests.config import tape, TweepyTestCase, username
from tweepy import API, FileCache, MemoryCache
from tweepy.models import Friendship
from tweepy.parsers import Parser
Expand Down
2 changes: 1 addition & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import random
import unittest

from .config import *
from tests.config import *
from tweepy import API, OAuthHandler


Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from .config import (
from tests.config import (
access_token, access_token_secret, bearer_token, consumer_key,
consumer_secret, tape, user_id
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cursors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .config import tape, TweepyTestCase, username
from tests.config import tape, TweepyTestCase, username
from tweepy import Cursor


Expand Down
2 changes: 1 addition & 1 deletion tests/test_rate_limit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import unittest

from .config import create_auth
from tests.config import create_auth
from tweepy import API
from tweepy.errors import HTTPException

Expand Down
2 changes: 1 addition & 1 deletion tests/test_resultset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .config import TweepyTestCase
from tests.config import TweepyTestCase

from tweepy.models import ResultSet

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
envlist = py36, py37, py38, py39

[testenv]
commands = python setup.py nosetests
commands = python -m unittest discover tests
extras = test

0 comments on commit b4c06a4

Please sign in to comment.