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

remove nose support #4460

Closed
zzzeek opened this issue Jan 22, 2019 · 8 comments
Closed

remove nose support #4460

zzzeek opened this issue Jan 22, 2019 · 8 comments
Labels
easy a one / two liner type of thing that anyone can do in short order. also see "fairly easy" tests
Milestone

Comments

@zzzeek
Copy link
Member

zzzeek commented Jan 22, 2019

for 1.3, let's see if we can just take out the "nosetests" code altogether, as nose itself hasn't seen new releases in years and pytest has long since become the most widely used testing tool. This would at most only impact packagers, who are likely using "setup.py test" for testing, as well as third party dialects who use SQLAlchemy's testing framework, however I doubt the nose framework even works anymore in any case (tries) nope doesnt work in Python 3 due to this:

 File "/home/classic/.venv3/lib/python3.7/site-packages/nose/suite.py", line 106, in _set_tests
    if isinstance(tests, collections.Callable) and not is_suite:
  File "/home/classic/.venv3/lib/python3.7/collections/__init__.py", line 52, in __getattr__
    DeprecationWarning, stacklevel=2)
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working

in python 2 it still works, very impressive. but we don't have the multi-process support so it still takes quite a long time to run.

note that we still will not hardcode pytest directives into the tests themselves, and the "test suite agnostic" system should stay in place. Only until a standard library testing elements should be within the tests themselves.

@zzzeek zzzeek added the tests label Jan 22, 2019
@zzzeek zzzeek added this to the 1.3 milestone Jan 22, 2019
@ParthS007
Copy link
Contributor

Hi @zzzeek
I want to work on this issue. How should I proceed with this?
Thanks

@zzzeek
Copy link
Member Author

zzzeek commented Jan 30, 2019

hi @ParthS007 -

this would mostly be removing files:

lib/sqlalchemy/testing/plugin/noseplugin.py  
sqla_nose.py

then removing things to do with "nose" from setup.cfg:

diff --git a/setup.cfg b/setup.cfg
index f0c0d4d5af..8f32d7ad13 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,12 +4,6 @@ tag_build = dev
 [metadata]
 license_file = LICENSE
 
-[nosetests]
-with-sqla_testing = true
-exclude = ^examples
-first-package-wins = true
-where = test
-
 [tool:pytest]
 addopts= --tb native -v -r sfxX --maxfail=25 -p no:warnings -p no:logging
 python_files=test/*test_*.py

then making sure nothing broke with py.test. pretty easy

@zzzeek
Copy link
Member Author

zzzeek commented Jan 30, 2019

but! it would be great if you can make sure you run the tests. a simple run is just like this:

tox -e py37

then let it go. takes awhile.

@zzzeek zzzeek added the easy a one / two liner type of thing that anyone can do in short order. also see "fairly easy" label Jan 30, 2019
@zzzeek
Copy link
Member Author

zzzeek commented Jan 30, 2019

also this:

diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py
index 9c9e311428..d45d1ae0f3 100644
--- a/lib/sqlalchemy/testing/plugin/plugin_base.py
+++ b/lib/sqlalchemy/testing/plugin/plugin_base.py
@@ -8,8 +8,9 @@
 """Testing extensions.
 
 this module is designed to work as a testing-framework-agnostic library,
-so that we can continue to support nose and also begin adding new
-functionality via py.test.
+created so that multiple test frameworks can be supported at once
+(mostly so that we can migrate to new ones).   The current target
+is py.test.
 
 """
 
@@ -244,8 +245,7 @@ def post_begin():
     for fn in post_configure:
         fn(options, file_config)
 
-    # late imports, has to happen after config as well
-    # as nose plugins like coverage
+    # late imports, has to happen after config.
     global util, fixtures, engines, exclusions, assertions
     global warnings, profiling, config, testing
     from sqlalchemy import testing  # noqa
@@ -575,7 +575,7 @@ def _setup_engine(cls):
 
 def before_test(test, test_module_name, test_class, test_name):
 
-    # like a nose id, e.g.:
+    # format looks like:
     # "test.aaa_profiling.test_compiler.CompileTest.test_update_whereclause"
 
     name = getattr(test_class, "_sa_orig_cls_name", test_class.__name__)

@ParthS007
Copy link
Contributor

Thanks for the help @zzzeek . I am working on this and will make a PR shortly. 👍

@ParthS007
Copy link
Contributor

@zzzeek I have made PR. Please review and let me know your view on it.
I have run tests by python setup.py test & tox and they ran successfully but py.test execution shows that sqlalchemy requires a certain version of mock i.e 0.8.2. This version is not a valid version no as I checked from PyPi .

@sqla-tester
Copy link
Collaborator

Parth Shandilya has proposed a fix for this issue in the master branch:

Fixes#4460: Removed Nose Support https://gerrit.sqlalchemy.org/1122

@sqla-tester
Copy link
Collaborator

Parth Shandilya has proposed a fix for this issue in the master branch:

Remove Nose support https://gerrit.sqlalchemy.org/1122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy a one / two liner type of thing that anyone can do in short order. also see "fairly easy" tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants