-
Notifications
You must be signed in to change notification settings - Fork 557
PYTHON-1297 Convert to pytest for running unit tests #1215
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5973ece
Swap testing package over to pytest
absurdfarce 05aa767
Bringing over the contents of PR 1171
absurdfarce 5388c2b
Some additional text updates around integration tests
absurdfarce 5c13e84
Bringing over the contents of PR 1214 (excluding Jenkinsfile changes)
absurdfarce 14a1d73
Regression when moving ot pytest. Running test_twistedreactor under …
absurdfarce 015b8dd
Jenkinsfile changes from PR 1214
absurdfarce 15993e8
Fixing borked Jenkinsfile changes re: Simulacron tests
absurdfarce 525fe18
tests.integration.cqlengine.test_batch_query now passes locally
absurdfarce fa466d7
Forgot to commit conftest.py files in earlier work
absurdfarce def27b5
Merge branch 'master' into python1297
absurdfarce c8a7f65
Skip asyncore tests unless we're dealing with a Python runtime before…
absurdfarce 9ac0066
Removing nose references from .gitignore and setup.py
absurdfarce 75f56e2
Trying to get Travis + AppVeyor working. Also a small doc fix.
absurdfarce 3545ebb
Trying to address issues with libev test failures on Travis due to in…
absurdfarce dafe49f
Attempting to add Python 3.11 and 3.12 to Travis
absurdfarce 4e9a407
Remove Python 3.12 until we can fix it robustly (see PYTHON-1392 for …
absurdfarce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ build | |
MANIFEST | ||
dist | ||
.coverage | ||
nosetests.xml | ||
cover/ | ||
docs/_build/ | ||
tests/integration/ccm | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,6 @@ | |
import sys | ||
import warnings | ||
|
||
if __name__ == '__main__' and sys.argv[1] == "gevent_nosetests": | ||
print("Running gevent tests") | ||
from gevent.monkey import patch_all | ||
patch_all() | ||
|
||
if __name__ == '__main__' and sys.argv[1] == "eventlet_nosetests": | ||
print("Running eventlet tests") | ||
from eventlet import monkey_patch | ||
monkey_patch() | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This monkey patch in the gevent/eventlet case is now handled in test infrastructure so we shouldn't need to support it as a CLI arg as well. There's also the fact that I can't find any actual usage of this arg anywhere... |
||
import ez_setup | ||
ez_setup.use_setuptools() | ||
|
||
|
@@ -48,19 +38,6 @@ | |
with open("README.rst") as f: | ||
long_description = f.read() | ||
|
||
|
||
try: | ||
from nose.commands import nosetests | ||
except ImportError: | ||
gevent_nosetests = None | ||
eventlet_nosetests = None | ||
else: | ||
class gevent_nosetests(nosetests): | ||
description = "run nosetests with gevent monkey patching" | ||
|
||
class eventlet_nosetests(nosetests): | ||
description = "run nosetests with eventlet monkey patching" | ||
|
||
has_cqlengine = False | ||
if __name__ == '__main__' and sys.argv[1] == "install": | ||
try: | ||
|
@@ -382,12 +359,6 @@ def pre_build_check(): | |
def run_setup(extensions): | ||
|
||
kw = {'cmdclass': {'doc': DocCommand}} | ||
if gevent_nosetests is not None: | ||
kw['cmdclass']['gevent_nosetests'] = gevent_nosetests | ||
|
||
if eventlet_nosetests is not None: | ||
kw['cmdclass']['eventlet_nosetests'] = eventlet_nosetests | ||
|
||
kw['cmdclass']['build_ext'] = build_extensions | ||
kw['ext_modules'] = [Extension('DUMMY', [])] # dummy extension makes sure build_ext is called for install | ||
|
||
|
@@ -435,7 +406,7 @@ def run_setup(extensions): | |
include_package_data=True, | ||
install_requires=dependencies, | ||
extras_require=_EXTRAS_REQUIRE, | ||
tests_require=['nose', 'PyYAML', 'pytz', 'sure'], | ||
tests_require=['pytest', 'PyYAML', 'pytz', 'sure'], | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
-r requirements.txt | ||
scales | ||
pynose | ||
pytest | ||
ccm>=2.1.2 | ||
pytz | ||
sure | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import pytest | ||
|
||
from tests.integration.cloud import setup_package, teardown_package | ||
|
||
@pytest.fixture(scope='session', autouse=True) | ||
def setup_and_teardown_packages(): | ||
setup_package() | ||
yield | ||
teardown_package() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import pytest | ||
|
||
from tests.integration import teardown_package | ||
|
||
@pytest.fixture(scope='session', autouse=True) | ||
def setup_and_teardown_packages(): | ||
print('setup') | ||
yield | ||
teardown_package() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pytest | ||
|
||
from tests.integration import teardown_package as parent_teardown_package | ||
from tests.integration.cqlengine import setup_package, teardown_package | ||
|
||
|
||
@pytest.fixture(scope='session', autouse=True) | ||
def setup_and_teardown_packages(): | ||
setup_package() | ||
yield | ||
teardown_package() | ||
parent_teardown_package() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import pytest | ||
|
||
from tests.integration.simulacron import teardown_package | ||
|
||
@pytest.fixture(scope='session', autouse=True) | ||
def setup_and_teardown_packages(): | ||
print('setup') | ||
yield | ||
teardown_package() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used in order-of-operations test fix discussed below